Set max-height on image transforms?
You can pass an array instead of the image-transform handle to the getUrl() function 

{% set transform = {
    'width' =&gt; 600,
    'height' =&gt; (asset.getWidth() &lt;= 800)? asset.getWidth() : 800
} %}
{{ asset.getUrl(transform) }}