Magento custom designed gallery plugin contains two modules.
You can guess, one is for displaying images on frontend and second one is for handling images and categories in backend.
I will not write too much about this modules because there are too much files and it will take too much time to describe.
Most of things used in this modules are already described by my working colleagues.
Backend module is based on interface for adding images of products in magento shop.
When you integrate it into your shop it will install two additional custom tables in database which will store data of your gallery (categories and images)