Something like this?
<% if GalleryItems.MoreThanOnePage %>
<ul id="pagination-imagegallery">
<% if GalleryItems.NotFirstPage %>
<li class="previous"><a title="<% _t('VIEWPREVIOUSPAGE','View the previous page') %>" href="$GalleryItems.PrevLink">«<% _t('PREVIOUS','Previous') %></a></li>
<% else %>
<li class="previous-off">«<% _t('PREVIOUS','Previous') %></li>
<% end_if %>
<% control GalleryItems.Pages %>
<% if CurrentBool %>
<li class="active">$PageNum</li>
<% else %>
<li><a href="$Link" title="<% sprintf(_t('VIEWPAGENUMBER','View page number %s'),$PageNum) %>">$PageNum</a></li>
<% end_if %>
<% end_control %>
<% if GalleryItems.NotLastPage %>
<li class="next"><a title="<% _t('VIEWNEXTPAGE', 'View the next page') %>" href="$GalleryItems.NextLink"><% _t('NEXT','Next') %> »</a></li>
<% else %>
<li class="next-off"><% _t('NEXT','Next') %> »</li>
<% end_if %>
</ul>
<% end_if %>