Cycle Plugin Pager Issue in Flicker API function

Cycle Plugin Pager Issue in Flicker API function

So I'm using the Flicker API to generate a slide show that pulls in the Image, Description and Title. I want to use the Cycle Plugin for the fade effect and Pager attribute to handle the navigation.

The problem is the Pager gets looped over-and-over along with the call to pull the images from Flickr:

Test Page: http://www.petermichaelsallen.com/flickrTesting

Script: http://www.petermichaelsallen.com/flickrTesting/flickr_import.js

   
  1.  $(document).ready(function(){
  2. var apiKey = 'e63c7b561755bc26ab3b400538a03876';
  3. $.getJSON('http://api.flickr.com/services/rest/?&method=flickr.photosets.getPhotos&api_key=' + apiKey + '&photoset_id=72157623065840087&format=json&jsoncallback=?',
  4. function(data){
  5. $.each(data.photoset.photo, function(i,item){
  6. var photoURL = 'http://farm' + item.farm + '.static.flickr.com/' + item.server + '/' + item.id + '_' + item.secret + '_m.jpg'
  7. var photoID = item.id;
  8. $.getJSON('http://api.flickr.com/services/rest/?&method=flickr.photos.getInfo&api_key=' + apiKey + '&photo_id=' + photoID + '&format=json&jsoncallback=?', function(data){
  9. var imgCont = '<div class="headlineStoryContainer" id="story' + i + '"><img alt="' + data.photo.title._content + '" src="' + photoURL +'#'+ i +'"/><h3>' + data.photo.description._content + '</h3></div>';
  10. $(imgCont).appendTo('#headlineContainer');
  11. $('#headlineContainer').cycle({
  12. fx: 'fade',
  13. speed: 1250,
  14. timeout: 10000,
  15. pager: '#headlineNav',
  16. pause: 7
  17. });
  18. });
  19. }); }); });

Naturally, I would move Cycle out of the loop, but if I do that Cycle won't fire.

What do I do?

Note: I'm not very prolific with javascript or jQuery, but I get the basic gist of it.