There is a possibility that he honestly forgot the gun was in there, at least thats what I'm going to make myself believe. I can't figure out what he could have been attempting as he knew they would find the gun through an x-ray.
They always say the exact same two things. It's either "I didn't know it was in there" or "I forgot it was in there". Only once have I ever seen anything different. An 82 year old man in Dallas was quoted as saying "Hell I'm from Texas, I thought I could!".