gallery bug fix