Updated the image ratio java script