This program is able to restore JPEG files after their accidental remove or partition format.
go get -u https://github.com/fxor/jpeg-recovery
jpeg-recovery -f discImage.img
JPEG files will be saved to the current directory.
jpeg-recovery -f /dev/sda
jpeg-recovery -f discImage.img -b 4096
If you find recovery process slow you can increase block size to look for JPEG header only every x bytes. By decreasing block size you are allowing for much more accurate search but time will increase. It is not recommended to go below 512 bytes (default value for -b) of block size because filesystems tend not to go below that limit of allocation size.