simplified comparer closure & improved image sorting; simplified folder name generation; other small code fixes;
Merge pull request #1 from SlKelevro/small-optimizations

php-related improvements