Add conditions to insert closing div row tag if the remainder is not 0