Error when recursively search down directory tree

This PR fixes that by filtering the sprite images by only the valid extensions.