Two ways to go here that I see. The first requires a little image editing skill and is the one I prefer here due to how small the image is or should be and the posibility of unexpected results with the second method. It goes like so:
Edit your image in an image editing program so that it is a square. To maintain the aspect ratio of the image itself, you can add transparent borders or borders that are the same color as the background of the image or of the progress bar's or whatever color you like. Many image editing programs can do this easily via an increase canvas size option.
The second requires editing the script and the results may be different than I expect, at least with some image sizes. The script assumed square blocks with each side equal to the height of the bar so, our added image had to be square. We could add a parameter here for the width of the image (this time all additions and changes are red):
and use it by adding it to the function like so:
var bar1= createBar(300,15,'white',1,'black','blue',85,7,3,"",20);
Notes: Be sure to scroll far enough to the right to see both changes in the above code block. The height of the image will still be the height of the bar. The bar's width must be set wide enough to accommodate all the image blocks' widths added together and then some. The wider your image relative to its height, the more likely this is to cause problems, though any dimensions may be fine. OR, it might be that any image that is not square will mess up another part of the script.
var t='<div id="_xpbar'+(++N)+'" style="visibility:visible; position:relative; overflow:hidden; width:'+w+'px; height:'+h+'px; background-color:'+bgc+'; border-color:'+brdC+'; border-width:'+brdW+'px; border-style:solid; font-size:1px;">';
t+='<span id="blocks'+N+'" style="left:-'+(h*2+1)+'px; position:absolute; font-size:1px">';
t+='<img src="mygif.gif" style="background-color:'+blkC+'; left:-'+((h*i)+i)+'px; font-size:1px; position:absolute; width:'+iw+'px; height:'+h+'px; '
var bA=(ie)?document.all['blocks'+N]:docume . . .