[API] Fixed version for RegenerateCachedImagesTask (former FlushGeneratedImagesTask) 

This is a fixed version for RegenerateCachedImagesTask (former FlushGeneratedImagesTask) such that it regenerates images instead of silently removing them and breaking existing pages

The pull request also contains some enhancements and fixes to the corresponding testcases.

Fixes https://github.com/silverstripe/silverstripe-cms/issues/318