test gallery function