Hmmmm, I’m not immediately sure what’s going on to be honest with you. I’ve never put a gallery together in this manner. I always use an unordered list. Have you tried using an unordered list? I think it gives you a little better control over everything, but that’s just me.
Here’s the code I’m using for my gallery… maybe it will help you out?
ul#gallery {
list-style: none;
padding-top: 5px;
margin-top: 20px;
}
ul#gallery li {
float: left;
margin: 0 10px 10px 10px;
}
ul#gallery li.galleryOne {
margin-left: 0;
}
ul#gallery li.galleryFour {
margin-right: 0;
}
ul#gallery li img {
border: 4px solid #ddd;
padding: 2px;
height: 130px;
width: 130px;
}
ul#gallery li a:hover img {
background: #ddd;
border-color: #ddd;
}
ul#gallery li p {
text-align: center;
margin-top: 2px;
font-size: 85%;
line-height: normal;
color: #777;
}
ul#gallery li p.gallery-description {
margin-top: 0;
}
.galleryPagination {
clear: left;
padding: 8px;
margin-top: 15px;
background: #eee;
border-top: 1px solid #ddd;
border-bottom: 1px solid #ddd;
}
.galleryPagination b {
border: 1px solid #08689a;
background: #fff;
color: #08689a;
padding: 1px 4px;
}
.galleryPagination a, .galleryPagination a:visited {
color: #08689a;
padding: 0 3px;
font-weight: bold;
text-decoration: none;
}
.galleryPagination a:hover {
text-decoration: underline;
}
<ul id="gallery" class="clearfix">
{exp:weblog:entries weblog="gallery" limit="2" disable="member_data|trackbacks" paginate="bottom"}
<li class="{switch="galleryOne|galleryTwo|galleryThree|galleryFour"}"><a href="{gallery-image}" title="{title}" rel="lightbox">{gallery-image}{gallery-image-name}
{gallery-image-description}</li>
{exp:reeposition}
{paginate}
{reeposition:item}
<div class="galleryPagination">
Page {current_page} of {total_pages} {pagination_links}
</div>
{/reeposition:item}
{/paginate}
{/exp:weblog:entries}
</ul>
{reeposition:put_item}
{/exp:reeposition}