{% from 'description.html' import img_description %}

  {% include 'download_zip.html' %}
  {% include 'map.html' %}
  <div class="gallery">
    {% for media in album.medias %}
      {% if media.thumbnail %}
        <figure class="gallery__img--{{ "main" if loop.first else "secondary" }} thumbnail">
          <a href="{{ media.url }}"
          {% if media.type == "image" %}
             data-pswp-width="{{media.size.width}}"
             data-pswp-height="{{media.size.height}}"
             {% if media.big %}
             data-big="{{ media.big_url }}"
             {%- endif -%}
          {% elif media.type == "video" %}
             data-pswp-type="video"
             data-pswp-width="800"
             data-pswp-height="600"
          {% endif %}
          >
            <img src="{{ media.thumbnail }}" alt="{{ media.url }}" />
          </a>
          <div class="pswp-caption-content">
            {{ img_description(media, with_big=False) }}
          </div>
          <figcaption>{{ media.title }}{{ (" - " + media.exif.datetime) if media.exif and media.exif.datetime else "" }}</figcaption>
        </figure>
      {% endif %}
    {% endfor %}
  </div>
