Magnetic and superconducting phase diagram of Nb/Gd/Nb trilayers