I once saw an image of Lord Vishnu wearing a sacred thread which Brahmin's wear on their body. Does this mean that Lord Vishnu is a Brahmin?
Yagnopavit or sacred thread is worn by dwijas (Brahmins , Kshatriya, Vaishya) not just Brahmins.
यज्ञोपवितम् परमम् पवित्रम् प्रजापतेर्यत् सहजं पुरस्तात् ।
आयुष्यमग्रं प्रतिमुन्चशुभ्रम् यज्ञोपवितम् बलम्स्तु तेज:॥
yajñopavitam paramam pavitram prajāpateryat sahajaṃ purastāt ।
āyuṣyamagraṃ pratimuncaśubhram yajñopavitam balamstu teja:॥
Put on the sacred thread, the supreme purifier, which was born along with Brahma long ago, which bestows long life, preeminence, and purity may the sacred thread bestow strength and light.
Shri Hari Vishnu is not a brahmin, he is above the caste or whatsoever is in this samsara or worldly things. He is supreme bramhan himself and he wears and does all the things in order to popularize the same things in front of his bhaktas. It is something like a fashion has to be popularized by a icon so Shri Hari does it and he says 'follow me if you want moksha', so he wears all these things so that we are benefited by doing what he does or in other words performing our duties and become nivritaa or free from debts.
Please note that emulating Shri Hari doesn't mean that you should have 3 wives or wear all those ornaments and think Goddess Devi Laxmi is your consort (she was and will be your mother forever) or consider yourself god but it just means do what he does, be humble like him, don't do anything out of excitement (i.e., take his sattva, don't just copy like a copycat but understand the meaning of everything and if you really wanna follow, follow Shri Rama as he is the ideal maryada purushottam avatar).
For more information see Who can wear Yajnopavita/Janeu/Sacred-Thread