If you are adding more than one grid, make sure you are using class name instead of id(since id must be unique and shall not be used by another element), and create a reusable function that will append the grid to the container and will create the More/Less button on the fly.
//Here is a reusable function that takes two parameter:
//container: an element that will contain the ul list, in your case newImg
//grid: ul element
function createGrid(container, grid)
{
$(container).append(grid);
$(grid).before('<button class="more_less">More</button>');
$(grid).find('.grid-item:gt(2)').hide();
$('.more_less').click(function() {
var $btn = $(this);
$btn.next().find('.grid-item:gt(2)').slideToggle();
$btn.text($btn.text() == 'More' ? 'Less' : 'More');
});
}
$(body).ready(function(){
$(".grid").each(function(index, grid){ createGrid($("#newImg"), grid) });
});
//This line of code will iterate for each element with class ".grid" and pass it to createGrid function
And for newly grids that are created after the previous code is executed, just use the function.
createGrid($("#newImg"), $("#new-grid");