Adding layout rule for galleries.