fix gallery migration