update preg_match for file upload

preg_match was catching non-image files as images sometimes
Merge pull request #321 from GhostToast/patch-1

update preg_match for file upload, props @GhostToast