Added support for landscape images.

Landscape images would have generated heights multiplied by the width instead of divided by. I fixed it to allow for both landscape and portrait images.