fix the bugs in update_head_image.php