Fixed most of double undo image issues by locking undomanager.