Hashed image links in retrieval knowledge base files

Hello everyone,

I would like to build an assistant with its own knowledge base uploaded in the form of text files. The files contain important articles. It is known that some content cannot coexist without including images in the response for the user. How do I force the model to always return a link to the photo when it is mentioned in the file and the paragraph from which the assistant draws the answer?
Below is a sample content to precisely illustrate what I mean.

This is a great text about how to click on a website.

  1. Click the pink button [IMG:link_to_the_photo1].
  2. Then click on the blue bar in the bottom right corner [IMG:link_to_the_photo2].

When processing a response from the assistant, if I encounter text enclosed in the tag [IMG:some_text], my script will convert it into an image and display it to the user.