I am trying to recreate/customize a tool (found here) which reads metadata from a JPG and creates a KML from it. The KML points to the relative path of the JPG and the image is displayed in the KML's pop-up window.
I cannot get the image to show up and was hoping someone had an idea. The image below shows what the KML looks like in Google Earth.

Here is the code that produces the KML.
<SPAN class="keyword token">for</SPAN> directory<SPAN class="punctuation token">,</SPAN> sub<SPAN class="punctuation token">,</SPAN> files <SPAN class="keyword token">in</SPAN> os<SPAN class="punctuation token">.</SPAN>walk<SPAN class="punctuation token">(</SPAN>imageDir<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">for</SPAN> f <SPAN class="keyword token">in</SPAN> files<SPAN class="punctuation token">:</SPAN>
fullpath <SPAN class="operator token">=</SPAN> os<SPAN class="punctuation token">.</SPAN>path<SPAN class="punctuation token">.</SPAN>join<SPAN class="punctuation token">(</SPAN>directory<SPAN class="punctuation token">,</SPAN> f<SPAN class="punctuation token">)</SPAN>
relpath <SPAN class="operator token">=</SPAN> os<SPAN class="punctuation token">.</SPAN>path<SPAN class="punctuation token">.</SPAN>relpath<SPAN class="punctuation token">(</SPAN>fullpath<SPAN class="punctuation token">)</SPAN> <SPAN class="comment token">#I've tried passing both fullpath and relpath to Text below</SPAN>
data <SPAN class="operator token">=</SPAN> get_exif_data<SPAN class="punctuation token">(</SPAN>fullpath<SPAN class="punctuation token">)</SPAN>
c <SPAN class="operator token">=</SPAN> get_lat_lon<SPAN class="punctuation token">(</SPAN>data<SPAN class="punctuation token">)</SPAN>
coordinates <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">(</SPAN>c<SPAN class="punctuation token">[</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN>c<SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN>
pnt <SPAN class="operator token">=</SPAN> kml<SPAN class="punctuation token">.</SPAN>newpoint<SPAN class="punctuation token">(</SPAN>name<SPAN class="operator token">=</SPAN>f<SPAN class="punctuation token">,</SPAN> coords <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">[</SPAN>coordinates<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN>
imgHeight <SPAN class="operator token">=</SPAN> data<SPAN class="punctuation token">[</SPAN><SPAN class="string token">'ImageLength'</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="operator token">/</SPAN><SPAN class="number token">4</SPAN>
imgWidth <SPAN class="operator token">=</SPAN> data<SPAN class="punctuation token">[</SPAN><SPAN class="string token">'ImageWidth'</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="operator token">/</SPAN><SPAN class="number token">4</SPAN>
project <SPAN class="operator token">=</SPAN> <SPAN class="string token">'Test'</SPAN>
date <SPAN class="operator token">=</SPAN> data<SPAN class="punctuation token">[</SPAN><SPAN class="string token">'DateTime'</SPAN><SPAN class="punctuation token">]</SPAN>
device <SPAN class="operator token">=</SPAN> <SPAN class="string token">'Apple iPhone'</SPAN>
Text <SPAN class="operator token">=</SPAN> <SPAN class="string token">'<img src="'</SPAN><SPAN class="operator token">+</SPAN>relpath<SPAN class="operator token">+</SPAN><SPAN class="string token">'" alt="path failed" width="{0}" height="{1}"'</SPAN><SPAN class="operator token">+</SPAN>\
<SPAN class="string token">'align="left"/>'</SPAN><SPAN class="punctuation token">.</SPAN>format<SPAN class="punctuation token">(</SPAN>imgWidth<SPAN class="punctuation token">,</SPAN> imgHeight<SPAN class="punctuation token">)</SPAN><SPAN class="operator token">+</SPAN>\
<SPAN class="string token">'<br>Project Name: {0}'</SPAN><SPAN class="operator token">+</SPAN>\
<SPAN class="string token">'<br>Capture Date & Time: {1}<br>Device: {2}'</SPAN><SPAN class="punctuation token">.</SPAN>format<SPAN class="punctuation token">(</SPAN>project<SPAN class="punctuation token">,</SPAN> date<SPAN class="punctuation token">,</SPAN> device<SPAN class="punctuation token">)</SPAN>
pnt<SPAN class="punctuation token">.</SPAN>style<SPAN class="punctuation token">.</SPAN>iconstyle<SPAN class="punctuation token">.</SPAN>icon<SPAN class="punctuation token">.</SPAN>href <SPAN class="operator token">=</SPAN><SPAN class="string token"><SPAN>"</SPAN><A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fmaps.google.com%2Fmapfiles%2Fkml%2Fshapes%2Fplacemark_circle.png" target="_blank">http://maps.google.com/mapfiles/kml/shapes/placemark_circle.png</A><SPAN>"</SPAN></SPAN>
kml<SPAN class="punctuation token">.</SPAN>save<SPAN class="punctuation token">(</SPAN>outKML<SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>Any ideas as to why this is happening. I'm 99% sure the path to the image is incorrect, but I'm out of ideas.