{% for image in images %} {% set img_path = "/".join(image['path'].split('/')[-3:]) %} {% if img_path.split('.')[-1] != "webm" %} {% else %} {% endif %} {% endfor %}