Retina support for toImage function