{% capture srcset %}

{% for i in resized %}
    /{{ i.path }} {{ i.width }}w,
{% endfor %}

{% endcapture %}

{% assign largest = resized | sort: 'width' | last %}

<img src=“/{{ largest.path }}” alt=“{{ alt }}” srcset=“{{ srcset | strip_newlines }}”>