I just took the 5/31 test, and I didn't have any idea what an imide was until I read this thread. But, anyway, I agree that the amine/ammonia thing is a helpful way to remember that one. Enamine is also pretty straightforward (alkene/amine). I remember amide because a peptide bond is an amide bond (helpful for me b/c I've looked at alot of peptide sequences in biochem, but I'm not sure if this will help you). Imines I just kinda memorized.