Performance of deleteImageAndChildren.

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