Edit:
There's undoubtably a more elegant way, but this would work:
<html><body>
<div style="position:absolute; left:0; top:0; width:50%; height:50%; background-color:blue">A</div>
<div style="position:absolute; left:50%; top:0; width:50%; height:50%; background-color:green">B</div>
<div style="position:absolute; left:0; top:50%; width:50%; height:50%; background-color:yellow">C</div>
<div style="position:absolute; left:50%; top:50%; width:50%; height:50%; background-color:red">D</div>
</body></html>
Original:
If you want the images to stretch to fill the content, it is unavoidable that the aspect ratio will change when the window size changes.
It sounds like what you actually want is to have the blocks keep the same aspect ratio, but scale to be as large as possible within the window, leaving extra space on the bottom or side if necessary.
Have a look at this question. You can set up a single div with the aspect ratio you want, and then split it internally into your four parts.