Not sure when this might be useful for people - but I have a need right now and found the answer so I wanted to share and also to keep it on file for myself!
$.fn.chunk = function(size) {
var arr = [];
for (var i = 0; i < this.length; i += size) {
arr.push(this.slice(i, i + size));
}
return this.pushStack(arr, "chunk", size);
}
$(".gallery-list-list .gallery-list-item").chunk(3).wrap('<div class="gallery-list-block"></div>');
Here’s a jsfiddle of it in action - http://jsfiddle.net/diarmuids/968j0rth/6/