- made gallery config available through parameters.
- cleaning code up;