Improved publishing performance by removing redundant file attrib lookups.
Cache moved up one level to -publishImageFile to remove excessive branching. Complexity is linear now.
Merge pull request #320 from NickyWeber/bugfix/issue_294_caching_broken_more_improvements

Bugfix/issue 294 caching broken more improvements