func GetGallery(id bson.ObjectId) (models.Gallery, error) {
	var gallery models.Gallery
	err := DB.C(galleriesCollection).FindId(id).One(&gallery)
	if err != nil {
		return models.Gallery{}, err
	}
	photos, err := GetGalleryPhotos(gallery.ID)
	if err != nil {
		return models.Gallery{}, err
	}
	gallery.Photos = photos
	gallery.PreviewPhoto, _ = GetPhotoByID(gallery.PreviewPhotoID)
	gallery.Title = getDefaultGalleryTitle(gallery)
	return gallery, err
}
GetGallery return specific gallery
package database
import (
	"time"
	"github.com/backpulse/core/models"
	"gopkg.in/mgo.v2/bson"
)
func CreateGallery(gallery models.Gallery) error {
	err := DB.C(galleriesCollection).Insert(gallery)
	return err
}
func SetDefaultGallery(site models.Site, gallery models.Gallery) error {
	_, err := DB.C(galleriesCollection).UpdateAll(bson.M{
		"site_id": site.ID,
	}, bson.M{
		"$set": bson.M{
			"default_gallery": false,
		},
	})
	if err != nil {
		return err
	}
	err = DB.C(galleriesCollection).UpdateId(gallery.ID, bson.M{
		"$set": bson.M{
			"default_gallery": true,
		},
	})
	return err
}
func UpdateGalleriesIndexes(siteID bson.ObjectId, galleries []models.Gallery) error {
	for _, g := range galleries {
		err := DB.C(galleriesCollection).Update(bson.M{
			"site_id": siteID,
			"_id":     g.ID,
		}, bson.M{
			"$set": bson.M{
				"index": g.Index,
			},
		})
		if err != nil {
			return err
		}
	}
	return nil
}
func GetGalleryByShortID(shortID string) (models.Gallery, error) {
	var gallery models.Gallery
	err := DB.C(galleriesCollection).Find(bson.M{
		"short_id": shortID,
	}).One(&gallery)
	if err != nil {
		return models.Gallery{}, err
	}
	photos, err := GetGalleryPhotos(gallery.ID)
	if err != nil {
		return models.Gallery{}, err
	}
	gallery.Photos = photos
	gallery.PreviewPhoto, _ = GetPhotoByID(gallery.PreviewPhotoID)
	gallery.Title = getDefaultGalleryTitle(gallery)
	return gallery, err
}