deleting the image file if it already exists