{% if transforms is not defined %}
  {% set transforms = {
    '(min-width: 1200px)': {
      width: 1920,
      height: 900
    },
    '(min-width: 992px)': {
      width: 1440,
      height: 780
    },
    '(min-width: 768px)': {
      width: 1024,
      height: 780
    },
    '(min-width: 576px)': {
      width: 480,
      height: 800
    },
    '': {
      width: 380,
      height: 700
    }
  } %}
{% endif %}

{% set common = {
  mode: 'crop',
  quality: 96,
  position: 'top-center',
  format: 'jpg'
} %}

{% set classCustom = '' %}
{% if setClass is defined %}
  {% set classCustom = setClass %}
{% endif %}

{% set parameters = {
  class: 'img-fluid ' ~ classCustom,
  alt: alt ?? img.title
} %}

{% set lazyload = true %}

{% if notLazy is defined %}
  {% set lazyload = notLazy %}
{% endif %}

{% if lazyload %}
  {% set parameters =
    parameters|merge({
      class: 'img-fluid lazyload ' ~ classCustom,
      data: {
        src: img.getUrl('imageHd')
      }
    })
  %}
{% endif %}

{% if (img|length) > 0 %}
  {{ craft.images.pictureMedia(img, transforms, common, parameters) }}
{% endif %}
