Some centuries ago, in both England and
France, the letters "I" and "Y" had the same phonetic value and their usage depended on the "taste" of the hand-writer. The letter "Y" was considered "more beautiful" and/or more legible (in hand-writing) and it was often preferred over "I".
Even now, letters "I" and "Y" have the same phonetic value in English.
Revolutionaries performed a spelling reform (approx. 1800) which assigned slight different values for "I" and "Y" in modern French.