Added is_dir check

Check if $sPath is a directory before looping the DirectoryIterator.
Merge pull request #4 from coffeemedia/master

Added is_dir check