Fix bugs in gallery templates, add albums into media.