try this:
find this
$link1 = htmlspecialchars('<a target="_blank" href="'.$config_path_image_upload.'/'.$file.'">');
and replace with this
$link1 = htmlspecialchars('<a target="_blank" href="'.$config_http_script_dir.'/'.$config_path_image_upload.'/'.$file.'">');
maybe it will be good for you