Make isValid() check only for UploadedFile instances
Merge pull request #5456 from leesherwood/4.2

Make isValid() check only for UploadedFile instances