fixing an issue where the parts variable was not defined anymore 

because of that, 
$filematch = $parts['dirname']."/pwg_representative/".$parts['filename']."-th_*"; (main.inc.php line 226)
was broken (when thumbnails_plugin is activated)