refactored user authentication logic into user.rb; added user profile photo on home page