Of course, the following contribs must installed first.
Download Page and Installation Instructions
Installation Problem and Solution
WPG2 can be activated but can't be validated.
Because WPG2 installation run into PHPBaseDir restriction.
See this topic in Forum Wordpress in /opt/wordpress + Gallery2 in /opt/gallery2 + WPG2 ? to solve it.