I see at least a quote problem here ...
// replace
pictureform += "<input type='file'...
// by
pictureform += "<input type='file' id='inp1' name='fileToUpload"+dID+"[]' onchange=\"fileUpload('picup"+dID+"','pictureupload.php','upload"+dID+"','picup"+dID+"');\"/></br>";
Plus add semicolon at the end of instructions, it will keep some syntax error risks away