$(function() {
   $("#page-images a:nth-child(5n)").addClass("last-in-row"); 
});
