Your question is more about your DB management than anything to do with Obj-C.
Think about using a new class in your DB called SharedImage
which hosts the image(s), a link to the originator and the recipient (1 to 1, so could us a pointer or a relationship) and any other data you need.
Now you can create these objects are you require and you can fetch them based on queries using the current user.
Also, for your existing friends
array which you said holds the usernames of the friends - it would probably be better to store the objectId
s of the friends instead of the usernames (because the username can usually be changed, but the objectId is static).