Assuming your NAS is always available and connected to your iMac, you can move both iPhoto and iTunes libraries to the NAS and use
- symbolic links from
~/Pictures
and~/Music
to fool the applications - start the application with Option pressed to select the alternative location
- iTunes: select alternative storage location in Options
- iPhoto: start by double-clicking moved library file