Also keep maxY into account when scaling a preview while preserving aspect ratio

The gallery app requires thumbnails with a fixed height while keeping the aspect ratio

cc @DeepDiver1975 @georgehrke