reconfigures db migrations and fixes galleries' thumbs