If “gif” has to be pronounced with a hard G because it stands for “graphics,” then the P in “jpeg” has to be pronounced like an F because it stands for “photographic.”
And it would be incorrect. The point is there are multiple ways to pronounce G in English, none more valid than the other. Heck, how do you pronounce G itself?