changed image regeneration as described in PR #1593