Depending on your need either could be valid. One interesting option is to do option (b) and then style image via CSS with object-fit property (https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit). Usually this is not recommended since it can display image in a imperfect layout. But in your case this could actually be a good compromise. E.g.
<amp-img class="unknown-size" width=300 height=200 src="..."></amp-img>
And CSS would be: