added code to detect if image is from a friend