Imaging stress and magnetism at high pressures using a nanoscale quantum sensor