Its quite simple actually change the code you add to:
if(isset($the_varialbe_that_is_undefined)){
//code you want to exexute
$image = $this->model_tool_image->resize($result['image'], $this->config->get('config_image_category_width'), $this->config->get('config_image_category_height'));
//end
}
It depends on what you want it to do, so you need to check the right variable,and afterwards call the code so you do not get these kind of errors.
Same logic is applied in every case that get this kind of error.