If you could send us a link to the map we could probably give you a better solution, but I think this is caused by a known bug that reorders the columns in the infowindows.
As you might already know, the column that contains the image URL must be the first one in the list of columns in the infowindow wizard (even though when you're using custom code!). What this bug provokes is that for custom infowindows, the columns are retrieved alphabetically instead of taking into account the order that the user selected. This raises the error that the URL is not valid (because it's obtaining probably any other column) when the map is shared.
In order to sort it out, I recommend to do a small hack to make sure your URL column will be always the first when the system reorders them alphabetically. You could rename it as _url, as the _ character takes precedence over letters and numbers.
If this trick doesn't solve your problem, please let us know more details!