When I like a photo of my friend, how can I prevent it to be seen in the notifications panel on the right of the screen so that only my friend would know that I liked the photo?
The only way would be for your friend to share the photo only with you. Anyone who can see a Facebook post can also see all likes and comments on it. The ticker on the right is a firehose of everything happening among your Facebook friends, including Likes. It displays everything chronologically without trying to prioritize anything (unlike the news feed, which may or may not show to your friends that you’ve liked a photo).
The only exception to this is if you have blocked some members of the photo’s audience. In that case they would see, eg. “7 people like this photo” but upon expanding the list of people who like the photo they might only see 6 names.