{% if record.filetype == "image" %}
{% thumbnail record width=width ratio=ratio %}
{% elif record.filetype == "video" %}
{% thumbnail record width=width ratio="16/9" %}
{% elif record.filetype == "audio" %}
{# cheat a bit and tell photoswipe this audio is a video, plyr will handle it #}
{% thumbnail record width=width ratio="1/1" %}
{% else %}
{# do not include documents in photoswipe gallery for now #}
{% thumbnail record width=width ratio="16/9" %}
{% endif %}
{% include "includes/file_pswp_caption.html" with file=record %}