Added check for profile_image before accessing its id