Layer name=imageLayer
What are the XY coordinates of the image's left and top?
The new contents for the 'coordinates' layer overwrite the old. It looks like the original size layer because we rewrote the whole layer tag with document.write. See Show XY coordinates for comparison.
Common sources of trouble are: