fixed issues with bad regexs and added mpg to the list of extensions