{% load thumbnail %}{% spaceless %} {% for elem in elements %} {% thumbnail instance.image elem.size zoom=elem.zoom crop=elem.crop upscale=elem.upscale subject_location=elem.subject_location as thumb %} {% if elem.tag == "source" %} {% elif elem.tag == "img" %} {% endif %} {% endfor %} {% endspaceless %}