Properly set mediaType of image.