{% block element_image %}
{% set config = element.fieldConfig.elements %}
<div class="cms-element-{{ element.type }}">
{% block element_product_slider_alignment %}
{% block element_image_inner %}
{% set imageElement %}
{% block element_image_container %}
{% if element.data.media.url %}
{% if element.config.imageRatio.value == 'aspect-square' %}
{% set image_ratio = 'ratio_1x1' %}
{% elseif element.config.imageRatio.value == 'aspect-video' %}
{% set image_ratio = 'ratio_16x9' %}
{% else %}
{% set image_ratio = 'ratio_3x4' %}
{% endif %}
<div class="cms-image-container ratio {{ image_ratio }}">
{% block element_image_media %}
{% set attributes = {
'alt': (element.data.media.translated.alt ?: ''),
'title': (element.data.media.translated.title ?: '')
} %}
{% if element.translated.config.displayMode.value == 'cover' or element.translated.config.displayMode.value == 'contain' %}
{% set attributes = attributes|merge({ 'data-object-fit': element.translated.config.displayMode.value }) %}
{% endif %}
{% sw_thumbnails 'cms-image-thumbnails' with {
media: element.data.media
} %}
{% endblock %}
</div>
{% endif %}
{% endblock %}
{% endset %}
{% if element.translated.config.url.value %}
<a href="{{ element.translated.config.url.value }}"
class="cms-image-link"
{% if element.translated.config.newTab.value %}target="_blank" rel="noopener"{% endif %}>
{{ imageElement }}
</a>
{% else %}
{{ imageElement }}
{% endif %}
{% endblock %}
{% if config.verticalAlign.value %}
</div>
{% endif %}
{% endblock %}
</div>
{% endblock %}