Resize the image on a separate thread