fix merged galleries on the same page