The module is probably not respecting the Orientation EXIF metadata in the original image. So when the image is scaled, this tag is omitted and the image appears to be rotated by 90 degrees.
If you are comfortable writing Java, my solution would be to find this data in the original image file and add it manually to the scaled image, or to rotate the image directly if detected.
I hope this helps.