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?
Nobody pronounces it with a hard G because of what the G stands for. Acronyms don’t work like that. They do it because a hard G is more common when starting words in English than a soft one.