Fixed issues in galleries