Fix issue arising when more than one row of images is present