Dropping the width and height attributes was correct advice for a decade of responsive design, and it is what makes a page jump while it loads.
<!-- the browser reserves the right box before the image arrives -->
<img src="/photo.jpg" width="800" height="600" alt="">
<style>
img { max-width: 100%; height: auto; } /* still responsive */
</style>
Browsers now compute an aspect ratio from the attributes and apply it before the image loads, so the space is reserved and nothing below it moves. The height: auto rule is what keeps the image responsive despite the fixed attributes, and omitting it produces distorted images — which is why the advice to remove the attributes existed in the first place. Cumulative Layout Shift is the metric this is measured by, and images without dimensions are usually most of it.