This doesn't happen when explicitly specifying the height of the image element.
Width doesn't seem to be affected.
Minimal HTML to reproduce:
<div style="
display:flex;
align-items:center;
height:200px;
border:1px solid black;">
<img src="https://ladybird.org/assets/img/ladybird_favicon.png">
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too