Ok, sorry. I did a little mistake. Place
ereg("(.+)\.(.+)", $file['file_path'], $regs);
$file['file_path'] = $regs[1].'.pdf';
ereg("(.+)\.(.+)", $file['file_name'], $regs);
$file['file_name'] = $regs[1].'.pdf';
below
if (!empty($file['file_path'])) {
You can now have thumbnail and image files. Pressing the download button offers you a pdf file for download which has the same name as the image file and is located in the same folder:
/data/media/1/test.jpg
/data/media/1/test.pdf
/data/thumbnails/1/test.jpg
Jan