Connecting gallery to image fields on dynamic page

I have a gallery in a dynamic page which I want to connect to the images in a database. Currently I can only connect to one specific image field, resulting in that gallery showcasing all of the pictures under the ‘image 1’ field for all the item rows in the database, instead of showing me images 1, 2 and 3 for the relevant item row. How do I connect the gallery to different image fields for an item row?