$(document).ready(function(){
    //This will run when the page has finished loading.
    var current_page=0;
    $(".image-pick").each(function(){		
      //For each of the things that have the class image-pick
      current_page = current_page+1;
      var current_image = this;
      //create the span that will be the pager "button"
      var html_button = '<span class="pager-button pager-'+current_page+'">'+current_page+'</span>';
      $('.image-picker-pager').append(html_button);
  
      //now attach an action to the pager button
      $(".pager-"+current_page).click(function(){
        //when someone clicks this pager hide all the other images
        $(".image-pick").hide();
        var curr_page = $(this).html();
        //then show this image
        $("#image"+curr_page).show();
      });
  
    });
    if(current_page == 1){
        $(".pager-1").hide();
    }
  });