Added new functionality for the galleries.