I'll add the depreciation to the PR.  For future reference the real problem with this function logic is line 1241, it blanks out the product image tag HTML before the function knows it has something to replace it with.