Thanks to some recent changes in browsers, it’s now well worth setting width and height attributes on your images to prevent layout shifts and improve the experience of your site visitors.
I’ve actually started using “normal” images again in some of my WordPress themes code, because using them as div backgrounds via CSS has top many unpredictable behavior…