The shapes of galaxy groups