I can only speak of iPhone5 and above, but that's simply not possible if done properly.
Settings --> General --> Reset --> Erase All Content and Setting. That will clear it back to factory settings. Perhaps you only chose the "Reset all Settings" option which left the content in place. That, or iCloud synced photos back to the phone when you signed in with your iCloud account with the iPhone.