changed how gallery in xml works