modify gallery to be fixed length