It was probably cutting off the end of the image tag so that the code wasn't recognizing it to replace it, but the browser was smart enough to still display it.
The solution is to remove the images first, then trim the length by simply changing the order of the code from your example. I've done that on your page and it seems to do the trick.