Filepicker now manage files previously uploaded

I've also rearranged the code

Maybe now  this part of code:
if($file = $this->get_setting()){
            $content .= html_writer::start_tag('p');
            if ($this->_options['isimagefile'] == true) {
                $content .= html_writer::empty_tag('img', array('src'=> $file));
            } else {
                $content .= $file;
            }
            $content .= html_writer::end_tag('p');
}
has to be:

if($file = $this->get_setting() && $this->_options['isimagefile'] == true){
   $content .= html_writer::start_tag('p');
   $content .= html_writer::empty_tag('img', array('src'=> $file));
   $content .= html_writer::end_tag('p');
}