Block weird image types from trying to imagecreatefrom*

i found an errror when i uploaded a favicon because it was trying to execute the function imagecreatefrom* with the mime type: image/vnd.microsoft.icon. So we set an array of valid suffixes and check against it.