{% load thumbnail %}
{% with widget.get_size as size %}
{% if widget.detail == "open_modal" %}
{% if widget.size %}
{% thumbnail image.file size format="PNG" as thumb %}
{% endthumbnail %}
{% else %}
{% endif %}
{% elif widget.detail == "open_new_window" %}
{% if widget.size %}
{% thumbnail image.file size format="PNG" as thumb %}
{% endthumbnail %}
{% else %}
{% endif %}
{% elif widget.detail == "on_page" %}
{% if widget.size %}
{% thumbnail image.file size format="PNG" as thumb %}
{% endthumbnail %}
{% else %}
{% endif %}
{% else %}
{% if widget.size %}
{% thumbnail image.file size format="PNG" as thumb %}
{% endthumbnail %}
{% else %}
{% endif %}
{% endif %}
{% endwith %}