fixed a bug with image dimensions