Fix bug with white spaces in galleries