refactor css gallery