Add support for image with different ratio

Hi,

The current version of the script was working only for a set of images with the same size.
In that pull request, we can use image with different size. The placement is not perfect, but at least, the ratio is preserved.

Thank you,

Mathieu