The black and white photo of Captain Nelly Hunt on the front of her NASA file is taken from the scene at Tony's retirement party which happens later.
After Jeannie II conjures up a copy of the history test, T.J. is heard to say "Oh, the history test!" and hugs her, but his lips don't move.