Hi.
In some "Sp Page Builder" addons (for example a simple image) it is easy to insert the height and width of the images.
This is also not a solution for SEO. And in general, CSS is not a solution to this problem.
The attributes of width and height in the tag are not CSS properties, but are HTML attributes. The values in these attributes should be added dynamically, depending on the size of the device screen.
To solve this problem, install and use some third -party component with on board the functionality of adding width and height attributes to <img> tags. For example, JCH Optimize has such functionality.