Instead of trying to explain the problem I need to solve, let me show you an example for better clarity (apologies to mobile users, this may not work...)
You can observe the effect I am aiming for on VICE news ()
While resizing the browser, notice how the image maintains its aspect ratio at specific sizes like 1200px and again at 700px, scaling both width and height simultaneously.
Is there a CSS-only solution to achieve this effect? I've been struggling with it for some time now.
Thank you!