when you upload the file you can get the file type with
$_FILES['varname'][type]
then you can do an if on that
$uploaded_file = $_FILES['varname'][type];
if ($uploaded_file == "image/jpeg" || $uploaded_file == "image/gif" || etc....)
not sure if those are the correct mime types, but i think you catch my drift