Improved version of image puzzle. Works well now