$(function() {
    $('.gallery').after('<ul id="thumbs">').cycle({ 
    fx:     'fade', 
    speed:  '1500', 
    timeout: '3000', 
    pager:  '#thumbs', 
     
    // callback fn that creates a thumbnail to use as pager anchor 
    pagerAnchorBuilder: function(idx, slide) { 
        return '<li><a href="#"><img src="' + slide.src + '" width="80" height="94" /></a></li>'; 
    } 
});

});

