SELECT `fm_agent_alerts`.`to_location`, `image_name` FROM `fm_agent_alerts` LEFT JOIN `fm_agents` ON `fm_agents`.`agent_id` = `fm_agent_alerts`.`agent_id` LEFT JOIN `fm_places` ON `fm_places`.`location_id` = `fm_agent_alerts`.`to_location_id` and `fm_places`.`location_type` = `fm_agent_alerts`.`to_location_type` LEFT JOIN `fm_images` ON `fm_images`.`view_id` = `fm_places`.`place_id` and `fm_images`.`type` = "PLACES" WHERE `fm_agent_alerts`.`status` = '1' AND `fm_agent_alerts`.`agent_id` = '11577'