{% if taxon.imagesByType('thumbnail') is not empty %}
    {% set path = taxon.imagesByType('thumbnail').first.path %}
{% elseif taxon.images.first %}
    {% set path = taxon.images.first.path %}
{% else %}
    {% set path = '//placehold.it/510x310' %}
{% endif %}

{{ dedi_sylius_image_optimizer_for_image(path, name|default('') , {
    'class' : 'img-fluid listing-header-img'
}) }}
