I also tube that problem. But solve it by an instance of an image every time you change the source (image).
It seems that would be called onload only once. But this way, you can change image whenever you want.
function chageIcon(domImg,srcImage)
{
var img = new Image();
img.onload = function()
{
// Load completed
domImg.src = this.src;
};
img.src = srcImage;
}
Mode use.
chageIcon(document.getElementById("img"),"newIcon.png");