Yeah it can get annoying when iTunes or iPhoto on your mac pop up and loads photos from your smartphone. It can show your private photos on screen so people nearby may see and that can be bad. Newer iOS versions ask you to give permission for the computer to access your phone but some iOS versions don’t.
In iPhoto, just open Preferences and on the first (General) pane you’ll see “Connecting camera opens…” The options are no application, iPhoto, or Image Capture. Set it to no application and you’re done.
Connect the iPhone. Select the phone in iTunes. On the Summary tab, uncheck “open iTunes when this iPhone is connected”.