{% load i18n wagtailimages_tags dsfr_tags %}
{% if value.title %}
  <{{ value.heading_tag|default:"h3" }}>{{ value.title }}</{{ value.heading_tag|default:"h3" }}>
{% endif %}
<figure class="fr-content-media {{ value.width }}{% if value.url %} fr-enlarge-link{% endif %}"
        role="group"
        aria-label="{{ value.caption }}">
  <div class="fr-content-media__img">
    {% if value.url %}
      <a href="{{ value.url }}">
        {% image value.image original class=value.extra_classes alt=value.alt %}
        <span class="fr-sr-only">{% translate "Go to page" %} {{ value.url }}</span>
      </a>
    {% else %}
      {% image value.image original class=value.extra_classes alt=value.alt %}
    {% endif %}
  </div>
  {% if value.caption %}<figcaption class="fr-content-media__caption">{{ value.caption }}</figcaption>{% endif %}
</figure>
