I had this problem when my friend logged into her facebook through the gallery on my htc. There is no log out option unless you go to your apps page, press the menu button (4lines) and go to 'ALL APPS', menu again to 'REMOVE APP' go to 'ALL' menu at the top of screen then scroll down to 'gallery' click on it and press 'CLEAR DATA'.This did not not delete my photos it just removed the log in information for flickr and facebook then gave me the option to sign out! ....