{% set OBJ = 'gallery' %}

{% if gallery_type == 'inline' %}<div class="is-scrollable">{% endif %}
<div class="{{ OBJ }} {% if gallery_type %}{{ OBJ }}--{{ gallery_type }}{% endif %}">
    {% for item in gallery %}
    <div class="{{ OBJ }}__item is-{{ item.landscape }}" data-item="{{ loop.index }}">
        <figure class="{{ OBJ }}__figure">
            <picture class="{{ OBJ }}__picture">
                <source media="(min-width: 1441px)" srcset="{{ item.src }}-f.{{ item.img_extension }}" />
                <source media="(min-width: 961px)" srcset="{{ item.src }}-b.{{ item.img_extension }}" />
                <source media="(min-width: 481px)" srcset="{{ item.src }}-m.{{ item.img_extension }}" />
                {% if item.landscape == 'landscape'%}
                    <img class="{{ OBJ }}__img" loading="lazy" src="{{ item.src }}-t.{{ item.img_extension }}" alt="{{ item.alt }}">
                {% else %}
                    <img class="{{ OBJ }}__img" loading="lazy" src="{{ item.src }}-m.{{ item.img_extension }}" alt="{{ item.alt }}">
                {% endif %}
            </picture>
        </figure>
    </div>
    {% endfor %}
</div>
{% if gallery_type == 'inline' %}</div>{% endif %}