SWC-1056: add support to scale images that have any aspect ratio