This is the 1224th most frequent Japanese word.
ついで
"Opportunity" or "while doing something else; on the occasion."
Here, "ついで" refers to doing something as a secondary action while primarily undertaking another action.
買い物に行くついでに郵便局に寄りました。
I stopped by the post office on the way to shopping.
In this sentence, "ついで" implies taking advantage of the main trip to Tokyo to also visit a museum.
東京に行くついでにあの美術館を訪れたい。
I want to visit that museum while going to Tokyo.
Here, "ついで" indicates that taking pictures was an additional action accompanying the walk.