Make image resizing smarter/faster