Fixed user login page with the correct images for the current user. Refactored codes in main.erb