Removing exit statements, moving send image to public function