I need to match the index number based on the image name number in the DB. for example index 1 = image 1

I need to match the index number based on the image name number in the DB. for example index 1 = image 1

You could
Do A Search for [Image DataType] and in that you can have a constraint of number = this cell’s index.
Let me know if you need help still 
That is not clear, index numbers are inside, not out. Please clarify what you mean exactly and the context of the request.
@joriziroj19, do you have 2 differents repeating groups ?
yes I have 2
if the intended result is to display Repeating Groups: image1 in cell 1, image2 in cell 2, image3 in cell 3 → it can be solved throught Sorting your RG based on “image_name”.