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