Apply the number of rows and colums on the imported image gallery properly.