{% set classes = [
  'media',
  'media--image',
  'media--image-photo-gallery'
] %}

{% set attributes = attributes|default(create_attribute()) %}
{% set attributes = attributes.setAttribute('class', classes) %}
{% set attributes = attributes.setAttribute('data-js', 'media-image') %}

{% if not media_caption %}
  {% set media_tag = 'div' %}
{% endif %}

{% extends "@ui-media/media.html.twig" %}

{% block media_content %}
  {{ media_image }}

  {% if media_caption %}
    <figcaption class="media__figcaption">
      {{ media_caption }}
    </figcaption>
  {% endif %}
{% endblock %}
