Factors controlling the phase inversion of oil-in-water emulsions