New code for user avatar, need some testing... not finished.