Corrected reading of width and height from images in prepare_images.py