Fix extension gussing

If UploadedFile instance we must get the extension a different way.