Gif - Jif, Jif - Gif Stolen from @Downgoat with permission

The point of this challenge is to (not) settle the  debate on the pronunciation of "gif".

"



The pronunciation of gif is debated and while it's supposed to be (and should be) pronounced jif, it's still commonly disputed.

In this challenge you will be given a set of words that have a g or j, representing the sound that the word is pronounced with. You'll also get some text in which you have to fix the incorrect spellings of gif.

Because this is the internet and everyone always wrong. It's (not) common courtesy to correct them.

An example of a wrong pronunciation would be:

There was a gif of a mouse eating a burrito

The wrong spelling of gif? Unacceptable! This must be corrected immediately:

There was a jif (as in jar) of a mouse eating a burrito



Are we done? Nope, you're still wrong.

You're always wrong

This must work the other way:

In the jif the cat wore a hat of a cat

This obvious misspelling must be fixed, we shall correct this to:

In the gif (as in graphic) the cat wore a hat of a cat



Rules


Input is a string (the sentence) and an array of strings (or any reasonable alternative, such as a comma separated string) in any order
You may take the g and j words in any order. They may be taken separately.
Every instance of gif (any case) in the sentence must be replaced with jif (as in ___) where ___ is a uniformly random selected word beginning with j  from the array of strings, and vice versa for jif with words beginning with g.
ONLY the words gif and jif should be replaced (i.e "jiffy" should not be changed). Those words have done no wrong.
You are guaranteed that at least one word in the array begins with g and at least one begins with j.
Case must be preserved (e.g. GiF -> JiF).
You may write a program or a function
Standard loopholes apply
We need to (not) settle the debate quickly; shortest code in bytes wins




Examples

Input and output separated by a single line:

graphic, jar, jam, gram
I saw a jif of how to pronounce gif that showed gif is pronounced jif

I saw a gif (as in graphic) of how to pronounce jif (as in jar) that showed jif (as in jam) is pronounced gif (as in gram)


gravy, jeff
G is for gIf, h is for JiF, i is for gIF, j is for JIf

G is for jIf (as in jeff), h is for GiF (as in gravy), i is for jIF (as in jeff), j is for JIf (as in gravy)

joke, june, gorilla, great
Jiffy should not be treated as a GIF or JIF, like gifted.

Jiffy should not be treated as a JIF (as in june) or GIF (as in great), like gifted.
Mathematica, 164 165 bytes

This is an abomination, but I want someone to share my pain.

StringReplace[f[f@"g"="j"]="g";f[f@"G"="J"]="G";z=IgnoreCase-&gt;1&gt;0;#,x:"g"|"j"~~y:"if ":&gt;{f@x,y,"(as in ",RandomChoice@StringCases[#2,f@x~~Except[","]..,z]}&lt;&gt;") ",z]&amp;


Function which expects the first argument # to be the sentence to be (in)corrected and the second argument #2 to a be comma separated string of words.

f[f@"g"="j"]="g";f[f@"G"="J"]="G" defines a function f which takes the letters g, G, j, and J to their appropriate replacements. This is ever so slightly shorter than f@"g"="j";f@"j"="g";f@"G"="J";f@"J"="G".

I also set z equal to IgnoreCase-&gt;True since I'll be using it twice.

x:"g"|"j"~~y:"if " is a StringExpression which matches "gif " or "jif ", naming the first letter x and the last three characters y. Since the option z (also known as IgnoreCase-&gt;True) is passed to StringReplace, these letters can be in any combination of upper and lower case.

I then replace every such match with

{f@x,y,"(as in ",RandomChoice@StringCases[#2,f@x~~Except[","]..,z]}&lt;&gt;") " 


RandomChoice@StringCases[#2,f@x~~Except[","]..,z] randomly selects a word out of the second argument #2 which begins with f[x], again ignoring case because the option z is given.