Hi Lynn.
First of all, you have not told us what gallery snippet you use. So my advice may not work.
Try to put your code into the placeholder object in your design. Place it where you want the...