That’s pretty easy/simple CSS.
I’d suggest picking just one of width or height, so that images always maintain their respective proportions.
Here, I’m using “VW” for sizing so that image sizes are readjusted along with browser window resizing.
For example: