While cloning set new image id into it's own variable.

This does not change the behavior at all. It is just a renaming
to prepare the clone fix.
fix clone history when cloning an image.
Merge branch 'fix-clone'

* fix-clone:
  fix clone history when cloning an image.
  While cloning set new image id into it's own variable.