Performance of deleteImageAndChildren.

Don't walk the file system for parents each time we recurse.

Fixes #2852
Merge pull request #2913 from pnasrat/2852-deleteimage-performance

Performance of deleteImageAndChildren.