      var count = 1000;
      for (var i=0; i<count; i++) {
        data.push({
          image: 'http://placehold.it/150x150/' + Math.floor(Math.random()*0xFFFFFF).toString(16) + '/ffffff&text=Index%20' + i,
          caption: 'Caption ' + i
        });
        var group = groups[gidx];
        if (!group) {
          if (nestedData) {
            group = groups[gidx] = {label: 'Group ' + gidx, length: 0};
          } else {
            group = groups[gidx] = {
              length: 0,
       