get rid of (almost) all references to Global from gallery