{% if image and image.file is defined %}
{% set useOriginal = image.useOriginal %}
{% set image = image.file %}
{% else %}
{% set useOriginal = false %}
{% endif %}
{% if image %}
{% if useOriginal %}
<img src="{{ fileUrl(image) }}" width="{{ width }}" height="{{ height }}" alt="" loading="lazy">
{% else %}
<picture>
<source type="image/webp" srcset="{{ webpImage(image, width, height) }} 2x" media="(max-width: 480px)">
<source type="image/webp" srcset="{{ webpImage(image, width, height) }}, {{ webpImage(image, width * 2, height * 2) }} 2x">
<img src="{{ resizeImage(image, width, height) }}" srcset="{{ resizeImage(image, width * 2, height * 2) }} 2x" alt="" width="{{ width }}" height="{{ height }}" loading="lazy">
</picture>
{% endif %}
{% else %}
<img src="/img/nophoto.svg" width="{{ width }}" height="{{ height }}" alt="Пока нет фото">
{% endif %}