Make sure JavaScript only attempts to update user image if logged in.