code: function(callback) {
        var firstThumbnail;
  
        for (var i = 0; i < thumbnailsPaths.length; i++) {
          var thumbnailsPath = thumbnailsPaths[i].thumbnailPath;
  
          if (!firstThumbnail)
            firstThumbnail = gm(thumbnailsPath);
          else
            firstThumbnail.append(thumbnailsPath, horizontally);
  
          images.push({
            sprite: destinationPath,
            image: thumbnailsPaths[i].originalPath,
            x: horizontally ? width * i : 0,
            y: horizontally ? 0 : height * i
          });
        }
        firstThumbnail
          .quality(quality)
          .write(destinationPath, callback);
      }
docs: Aggregate thumbnails