To get item displaying correctly you should make sure that your last viewed item display code is on the pages you would like this information to appear. For the current item taking place of the last item you should move your code that sets the session variable to the very bottom of the page after all of the display stuff. This way the first time you are viewing an item there is no previous item to display, then when you view another it will display the last and also update the code to store the current one.
As for updating this to retain the last three items it is definitely possible but will require a little bit of custom coding. I think the best way to do this would be to use an array, and just add the current item to the end of this array. You should then get rid of all but the last three elements of the array, then display them in descending order.