Well, allowing the files based on the filename extension is easy enough. The thing is though, the code that you showed checks for the "true" filetype by calling exif_imagetype to examine the file contents so as to determine its type... if the content is formed among the supported image formats. If you are trying to process non-image formats, then this is a consideration: what if the user simply renames a file and uploads it? If you are okay with that, e.g., the server is correctly configured to serve such files, then perhaps all you need to do is check the filename extension, which you can do with [man]pathinfo/man.
By the way, you should use the named constants instead of magic numbers, e.g.,
if ($fileSize > $maxSize) {
header("Location:" . $returnURL . "?err=tooBig");
exit;
}
$trueFileType = exif_imagetype($fileTempName);
switch ($trueFileType) {
case IMAGETYPE_GIF:
$fileExt = ".gif";
break;
case IMAGETYPE_JPEG:
$fileExt = ".jpg";
break;
case IMAGETYPE_PNG:
$fileExt = ".png";
break;
default:
header("Location:" . $returnURL . "?err=WrongFileType");
exit;
}