returned to the old version, deepCopyImage function added