added support for restrict_image_size and retina display