<figure class="image">
    {% if page is defined %}
    {%   set len = page.components | length %}
    {%   set p = page.components | slice(end=len - 1) | join(sep='/') %}
    {% else %}
    {%   set p = section.components | join(sep='/') %}
    {% endif %}

    <img src="{{ get_url(path=p  ~ "/" ~ file) }}">
</figure>
