{% load wagtailimages_tags %}

<a href="{{self.url}}"
	{% if settings.django_cos.AnalyticsSettings.ga_track_button_clicks and not format == 'amp' %}
		onclick="ga('send', 'event', '{{self.settings.ga_tracking_event_category|default:'ImageLink'}}', 'click', '{{self.settings.ga_tracking_event_label|default:self.alt_text}}');"
	{% endif %}
  title="{{ self.alt_text|safe }}"
  {% if self.settings.custom_id %}id="{{ self.settings.custom_id }}"{% endif %}>
	{% image self.image max-1000x1000 as self_image %}
	<img src="{{self_image.url}}" class="img-fluid {{self.settings.custom_css_class}}" alt="{{self.alt_text|safe}}" />
</a>