I think he may have meant a SIM card. Phones on AT&T and Verizon have SIM slots and cards, and people can move these cards to other phones in order to tie their account and phone together. At least that's how I understand it. I don't have an iPhone, and I'm on Sprint, so I'm speaking from limited experience.
That said, certain phones have the ability to store contacts and pictures on the SIM card or the phone's internal memory. Just a wild guess, but I doubt the iPhone has a SIM card, or even if it does, it's probably not user-serviceable.
Seghers, if you reset your phone to its factory default settings, that should clear out your account and remove all of your personal information from the phone. That being said, it won't be easy for someone to recover your photos, as they still may be recoverable with the way data is stored on any storage medium, whether its a hard disk drive or flash memory. Someone with the right tools and who knows what they're doing may come across the photos, but it isn't easy for the average Joe. Hell, I consider myself really technologically advanced, and even I don't know how to reliably recover deleted data from a storage medium.
Thing is, unless the person you're giving your old phone to knows there were dirty photos on it, and has an undying desire to see them, you're probably safe as long as you do a factory reset. Other than that, to be as close to totally sure as possible, look for a utility to "wipe" your phone, or just fill it all the way up until it's full. When you delete a file, whether it is a document, photo, or video, it's just marked for deletion, and the space it was taking up is considered free, but the data doesn't actually go anywhere until something takes up the space that the old file originally took up. If you fill your phone all the way up with random data (just copy a bunch of big movies to it until it's full), you have a good chance of overwriting the parts that used to store your photos so that they are no longer recoverable.
It does take quite a bit of effort, so you have to weigh how much chance the new owner of your phone will try to recover these photos, if they even knew to look for them, and how much it would damage your reputation if they were found. Good luck!