Looks like it's all working except the first radar tab.
That gif image adds another dimension to it.
Along with the .png and .jpg replace we need to add .gif to the mix.
So add gif to the solution....
$html = preg_replace("/\.png(.+?)/" , ".png " , $html); // cut off random numbering of png
$html = preg_replace("/\.jpg\?(.+?)/" , ".jpg " , $html); // cut off random numbering of jpg
$html = preg_replace("/\.gif\?(.+?)/" , ".gif " , $html); // cut off random numbering of gif