corrects file extension code to use pathinfo. fixes #2
Merge pull request #3 from kmindi/master

fixes #2