Optimizing the internal phase reference to shape the output of a multimode optical fiber