removed while loop in create_gallery and added createRow