Clear the image from memory before resizing it