many fixes done. also implemented the gallery on reference pages