Dynamic gallery

is there a way to add a set of pictures in a database column instead of only one at the same time to feed a gallery in a dynamic item page?

So let says we’ve got a database of product A,B,C…Z… for each of them you have several pictures (not the same amount) and you want to make a gallery inside the product dynamic page which represent those pictures. How would you proceed??