{% load wagtailimages_tags %}

{# blocks templates don't have style blocks, hence the css like this #}
<style type="text/css">
    .header_content .image_link img {
        height: auto;
        max-height: unset;
        padding: 10px;
    }
</style>

<a href="{% if self.page %} {{self.page.url}} {% else %} {{self.external_link}} {% endif %}">
    {% image self.image max-500x500 %}
</a>
