How about fixing it from your Admin?

Admin> Catalog> Attribute Nmae Manager> Chose the attribute you have added the images to, click edit, on the next page set the number of attribute images per row that you would like.