Bugfix/issue 294 caching broken more improvements

Improved publishing performance by removing redundant file attrib lookups.

Cache moved up one level to -publishImageFile to remove excessive branching. Complexity is linear now.