this is still a WIP, no confirmation that this actually leads to a useful image.. i am currently waiting for the image to be completely downloaded first things first.. the process involved in this could also be used to root your phone, but suppose you don't want to root your phone to keep it stock and to receive all those ota updates in the future without issue, this is a method where your phone will not be modified in any way but you can still dump a partition into a file in order to restore lost images or do other stuff with it.
you will need a windows pc for the odin step.. if you don't have a windows computer available, you might try to use “Heimdall” which should be able to do the same i've read.. however, on a rare occation a did have a windows pc available, so i stuck to odin ;)
adb shell ls -al /dev/block/platform/15570000.ufs/by-name/ <code> will give you a handy list of what partition holds what kind of data in order to decide which you want to dump.. i went for the one holding USERDATA as this is where i can proabably find those lost images. on my phone that was linked to /dev/block/sda18, so i ran this command (from the linux machine running adb): * <code>adb shell 'stty raw && dd if=/dev/block/sda18' > /root/martina.img
make sure you have some other hobbies that you can attend to for the moment, as this will take very long! my phone could download about 4 GB in 10 minutes.. so suppose this is probably a 128GB phone and most of the space is reserved for user data, this can take several hours..