Fixed error when running in PHP 5.3.5 and lower because the DirectoryIterator::getExtension method was not available.