{% macro gallery_images_index(from, to, images) -%}
{% for i in range(from, to) %}
{% endfor %}
{%- endmacro %}
{% macro gallery_images_string(from, to, images) -%}
{% set index = namespace(value=0) %}
{% set first_photo = namespace(value=-1) %}
{% for image in images %}
{% if image.name >= from and image.name <= to %}
{% if first_photo.value == -1 %}
{% set first_photo.value = loop.index %}
{% endif %}
{% set index.value = index.value + 1 %}
{% endif %}
{% endfor %}