copied changes from helper at surreal cms to get gallery captions to work