I would build a web extension dedicated to finding this type of pattern in a page (•image="a horse"•), and that would pass that string to an AI api which role would be to generate an image from it. Then the web extension would integrate the generated picture, appending an <img> tag.