fix gallery controller