Make isValid() check only for UploadedFile instances