Changed grid behavior for gallery