{% load thumbnail %} {% if file.url.lower|slice:"-3:" == 'svg'%} {{ file.url }} {% else %} {% thumbnail file "100" crop="top" as img %} {{ file.url }} {% empty %} ---- {% endthumbnail %} {% endif %}