Uploads the image with its correct extension