overhaul ImageCleanupTask, to fix issue #97 and issue #102