Relative sizing with component proportions?

I have a GridLayout I’m making which is populated with a bunch of pictures. The GridLayout itself is set to SizeFull(), as is each individual image in the grid.

The grid with the pictures is within another grid, and that grid has relative sizes set for its rows and columns.

With this set up, the grid of pictures stays within the spot I want it to, properly resizing to fit within the space they should, but the pictures do not retain their proper square proportions. They squish fat or skinny however they want. I want them to retain the original proportions, though, so they expand to fill their available area as much as possible while retaining those proportions.

If I set the images’ width to 100%, or the height to 100%, and leave the other undefined, then it retains the proportions, and properly expands to fit the one that is set to 100%, but the other spills outside the nested grid layout’s spot in the upper grid layout.

Anyone know how to do this? Is it possible to keep things proportional when being dynamically resized to stay inside a grid?