Alexey, I would like to help you, but I do not understand what you are trying to achieve. You mention “templates” and “models”, concepts unknown in Wix Code.
Could you simply describe in plain English what you are looking for? Do I understand correctly that you balk at adding 50+ image columns to a row? If that is part of your problem, why not implement a 1-n relation between “owner” of the gallery and his n images? Have you searched this forum? It has come up before.