Re-add the row classes to the image gallery (see #5658)