Why does the rendering with DOCTYPE have the unwanted effect of having the additional spacing after the first image. The unwanted space is in the position where the 0px height image would be?
Without DOCTYPE: https://codesandbox.io/s/image-taking-space-in-block-layout-forked-76oyl?file=/index.html
<html>
<body>
<div style="background-color: red;">
<img
alt="asd"
src="https://www.wallpaperuse.com/wallp/0-1226_m.jpg"
width="500"
height="500"
style="height: 200px;"
/>
<img
alt="asd"
src="https://www.wallpaperuse.com/wallp/0-1226_m.jpg"
width="500"
height="500"
style="height: 0px;"
/>
</div>
</body>
</html>
With DOCTYPE: https://codesandbox.io/s/image-taking-space-in-block-layout-forked-rlsct?file=/index.html
<!DOCTYPE html>
<html>
<body>
<div style="background-color: red;">
<img
alt="asd"
src="https://www.wallpaperuse.com/wallp/0-1226_m.jpg"
style="width: 500px; height: 200px;"
/>
<img
alt="asd"
src="https://www.wallpaperuse.com/wallp/0-1226_m.jpg"
style="width: 500px; height: 0px;"
/>
</div>
</body>
</html>