The gallery2 contrib is creating and using a database named 'gallery2' with a username of 'gallery2user', as well as several template fragments controlling the proper configuration of apache for use with gallery2.
If the egroupware contrib creates a database of the same name for its gallery2 add-on, but uses a different username, you may get very odd behavior. If it (or any other contrib you have installed) modifies the apache configuration file in a way that conflicts with the settings required for gallery2, you will have problems.
The bug tracker is *very* useful for getting knowledgeable programmers and developers to help you troubleshoot what is going on with your system - I urge you (again) to create a bug in the bug tracker. If you don't want to create a bug, you must decide that the gallery2 contrib does not work -- therefore, uninstall it and install the application manually.