This is the 1224th most frequent Japanese word.
ついで
"Opportunity" or "while doing something else; on the occasion."
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.
散歩のついでに写真を撮りました。
I took pictures while taking a walk.
Here, "ついで" refers to doing something as a secondary action while primarily undertaking another action.