Fix test issue with UploadedFile
Improve Media validation if the media is not valid