Simple python code to generate mosaic images from a bunch of images