Can you give us more descriptions about your current implementation?
You can use css positioning as described in https://www.w3schools.com/css/tryit.asp?filename=trycss_position_absolute .
An element with position: absolute; is positioned relative to the nearest positioned ancestor
So you can use this to position image and text in context to each other. With the z-index you can make sure that the text will be shown above your image.