On the origin of molecular oxygen on the surface of Ganymede