It can be done the same way you do it for any other link. Search for Cosmetic Links and you will find a hack that will turn all the buttons up top (my profile/register/search/faq/forum home), into graphics.
So look at the code, and see how you change the links to graphics, but do it for login instead of the other links. Or do it for those ones to test it out, and you will notice as you are adding and replacing the code. You will see the difference in the coding. Copy the different code, and add it into your login/logout line.
Maybe somebody else can tell him exactly which file to look in?