Add the image raito mechanism for image preview