Please check the OP: the first image is actually resized to 50x50, and the way it is done is just fine and should work for any ratio (I believe it crops the picture from the top center with full width, and with height that is adjusted for the declared size ratio, then resized).
The problem is that for the image which has a low w/h pixel ratio but an acceptable manually set screen ratio the global setting shouldn’t kick in.
Manually set ratio should take precendence, as this setting is meant to prevent the picture from dominating the large portion of the display (on account of its height), which it clearly doesn’t at 50x50.