{# inspired from @attach/display-image-macro.twig #}
{% macro displayImageWithoutCache(attachClass, baseUrl, imageFullPath, fieldName, thumbnailHeight, thumbnailWidth, imageHeight, imageWidth, class = "",mode = "fit", showThumbnail = true) %}
  {% set shortImageName = imageFullPath|split('/')|slice(-1,1)|first %}
  {% if thumbnailHeight is not empty and thumbnailWidth is not empty %}
    {% set thumbnailLink = baseUrl ~ attachClass.getResizedFilename(imageFullPath,thumbnailHeight,thumbnailHeight,mode ?? "fit") %}
    {% if imageHeight is not empty and imageWidth is not empty %}
      {% set resizedImageLink = baseUrl ~ attachClass.getResizedFilename(imageFullPath,imageHeight,imageWidth,mode ?? "fit") %}
      <a data-id="{{ fieldName }}" 
        class="modalbox {{class}}" 
        href="{{ resizedImageLink }}" 
        title="{{ shortImageName|e('html_attr') }}">
        <img loading="lazy" src="{{ showThumbnail ? thumbnailLink : resizedImageLink }}" 
          alt="{{ shortImageName|e('html_attr') }}"
          onerror=this.src="{{ baseUrl ~  imageFullPath}}" />
      </a>
    {% else %}
      <a data-id="{{ fieldName }}" 
        class="modalbox {{class}}" 
        href="{{ imageFullPath }}" 
        title="{{ shortImageName|e('html_attr') }}">
        <img loading="lazy" class="img-responsive" 
          src="{{ thumbnailLink }}"
          alt="{{ shortImageName|e('html_attr') }}"
          rel="{{ baseUrl ~ imageFullPath }}"
          onerror=this.src="{{ baseUrl ~  imageFullPath}}" />
      </a>
    {% endif %}
  {% elseif imageHeight is not empty and imageWidth is not empty %}
      {% set resizedImageLink = baseUrl ~ attachClass.getResizedFilename(imageFullPath,imageHeight,imageWidth,mode ?? "fit") %}
    <img loading="lazy" src="{{ resizedImageLink }}"
      class="img-responsive {{class}}"
      alt="{{ shortImageName|e('html_attr') }}"
      onerror=this.src="{{ baseUrl ~  imageFullPath}}" />
  {% else %}
    <img loading="lazy" src="{{ baseUrl ~ imageFullPath }}"
      class="img-responsive {{class}}"
      alt="{{ shortImageName|e('html_attr') }}" />
  {% endif %}
{% endmacro displayImageWithoutCache %}

{{ _self.displayImageWithoutCache(attachClass, baseUrl, imageFullPath, fieldName, thumbnailHeight, thumbnailWidth, imageHeight, imageWidth, class ?? "",mode ?? "fit", showThumbnail ?? true) }}