added CachedForeignKey for gallery
Merge pull request #4 from MichalMaM/master

added CachedForeignKey for gallery