Indeed, the browser would have to know the size of the image that isn't being displayed yet, in order to know how much real estate to reserve within the page.
Maybe someone knows of the smarter or more modern method, but so far as I know, you would have to change phpBB to use image horizontal and vertical size data of each image attachment to render the
<img> tags with a specific
width= attribute, in addition to the lazy load processing. Such that even when the
<img> tags are still "blank", they already require the same amount of horizontal and vertical room the displayed image will also eventually require.
That seems like it would require an extension on both points: Making best effort to determine accurate image dimensions for the thumbnail or attachment to be displayed, and then modifying the rendered
<img> tags to include the specific