Sorry but I don't have an easy solution to offer. You generally should not modify mojoPortal code such as gallery.ascx. You could clone the Image Gallery feature into a new separate feature but that is pretty drastic and requires strong development skills and significant work to accomplish.
If you do modify gallery.ascx you will have to modify it again after every release.
If you modify it and send me the modified copy along with notes about what you changed and why then maybe I can figure out a way to make changes in the next release to help you accomplish what you are trying to do. joe dot audette at g mail dotcom
Best,
Joe