layoutattribute help you making responsive image much easier than if you'd use css alone.
Responsive Image in AMP HTML
Create responsive image by specifying
height, setting layout to
responsive. See below example.
<amp-img src="/img/nature.jpg" width="1054" height="560" layout="responsive" alt="an image"></amp-img>From above code
layout="responsive"attribute make this
amp-imgelement automatically fits the width and height with it's container elements on different devices.
Extra Tips: You must specify image width and height, without it's, you can't verify your amp page by amp validator tools