php, images, jquery - results in a jquery error

php, images, jquery - results in a jquery error

Calling this link inside the same window as the mobile jquery results in the path of the image inside the page changing. This is a php page that adds the path to the image that the page is to display.

If I have it open in a new window, it displays fine. If I have it just as a link or if I add the dialog role to the link, the image path changes - in firefox I can see it happen - the image displays and then it turns to a broken link:

the error message in chrome is 
Resource interpreted as Image but transferred with MIME type text/html: " http://mysite.com/test/m/index.php?main_page=popup_image_additional&pID=2…image_large_additional=images/microsoft/images/microsoft/imexplorer_34.gif ".

I can't see how to change the php coding to make this work - tis a bit complicated.(open source script)

Is there something jquery-wise I can do to make this work? I found some hints here and there on the web but since this is the only problem anywhere on the site I'm not thinking I've run across the correct answer.

The link looks like this