Gallery bug fix