My guess is that you have other event handlers that are firing and stealing the initial click.
Please will you elaborate your html code to show where the <img> elements are rendered within the DOM tree.
Also, please list all other event handlers attached to elements anywhere between the <img> elements and upwards in the DOM tree right up to "document".