Didn't update the reference to the target element for reassigning of its id and src.