When using image_sizes in combination with other scripts which manipulates the DOM it can happen that the initialization fails. In my case I use splide.js to create slideshows.
This results in the following error message:
Uncaught TypeError: Cannot read properties of null (reading 'content')
at new <anonymous> (image-sizes.js?v=1.0.4:36:42)
Add a fallback img structure.
Needs review
4.0
Code