Given a HTML snippet
<div class="swiper-slide">
<div layout="row" layout-align="start stretch" flex style="height: 100%;">
<div layout="row" layout-align="center center" flex="grow">
<img src="/media/{{mediaId}}/h/1440">
</div>
</div>
</div>
and it's CSS as
img {
width: auto;
height: auto;
max-width: 100%;
max-height: 100%;
}
The image does remain centered and does not grow beyond it's parent container, however it does horizontally stretch or shrink when the component is resized. Is it possible to tell that the image element should preserve the aspect ratio of the displayed image?