Optimize getFile function

By checking for getimagesize only on actual images files, based on extension
Merge pull request #3 from agenceamiral/master

Optimize getFiles function