fix gallery creation