public function is_image($path){
        if( !file_exists($path) || !($info = getimagesize($path)) ){
            return false;
        }
        return (bool) preg_match("/^image\/(jpeg|png|gif)$/", $info['mime']);
    }