Would be nice to rename `trimmedSize` to something else, because what you are doing here is not trimming as the jargon goes, merely resizing with a fixed aspect ratio. Separate commit please.