- Fixed "PHP Warning: Invalid argument supplied for foreach()" in Image::checkNumberOfAllowedFilters() when glob() returns false
- Moved Image::checkNumberOfAllowedFilters() and Image::checkReferrer() calls into Image::setupFile() function
- Removed duplicate code in Image::checkCache()
Merge pull request #23 from elkangaroo/fix-php-warning-for-uncached-images

Fixing a PHP Warning: Invalid argument supplied for foreach() due to glob() sometimes returning false rather than an array.  Plus some refactoring changes to remove duplicate code.