If the corruption hasn't spread too far, then your JPEG files are now marked as directories (and so irretrievable by normal undeletion/recovery tools, which would recover them as directories or, worse still, believe them to be too corrupt and permanently clear them), but the image data is still there.
Recovering it isn't guaranteed and isn't fast. You need to access the portable drive in device mode, i.e., as if it was a single very large file. On Linux you would do that by dd
'ing its contents to a new file on the fixed drive (provided there's enough space). There is a utility in Windows called WinDD which could help you.
At this point you have to make a big assumption - that your JPEG files were stored as contiguous (i.e. defragmented) data blocks. If this holds, then the big file that is your portable drive contents will look like:
<garbage><garbage><valid JPEG header><valid SOI chunk>....<valid EOI chunk><garbage>...
and a file scanner will be able to start saving data as soon as the valid JPEG header is encountered, and go on until the End-Of-Image chunk is encountered. The blocks thus extracted will make up a valid JPEG file, for which you'll have lost the name, but that is a minor hurdle, I think.
There are utilities (I seem to remember "SDrecover"?) that are designed to recover data from unreadable SD cards. Of course they're not limited to SD cards (unless they require a FAT32/exFAT format on the device, which is a stupid request). They work in the same manner, reading sequentially the drive, ignoring everything they can't read, and trying to extract valid image streams. Some of them are capable of "juggling" the valid JPEG image chunks they find, and thus recover even fragmented files. But the key to the recovery is
- do not write anything else on the drive
- do not run any "disk fix" utility
- if possible, make a "clone" image of the disk
- if possible, work on the clone, not the original
- use the appropriate tool
You can find other tools (freeware, even) by googling for "JPEG recovery from damaged SD card", and synonyms thereof. I even have some Linux tested C source code, in case you feel adventurous and are comfortable with compiling.