Recova is freeware, but it primarily works with magnetic storage. I'm also not sure it will work over USB (which rules out any photos saved to the phone's internal memory) I've attempted it on an SSD (such as an SD card) and it almost always fails. The fact is that when you delete a file on a magnetic hard drive it just clears the information regarding how to access it. The file itself is still intact. When you save a new file, it just writes on top of it (which destroys the file at that point). In an SSD you can't just overwrite a file. You have to really delete it. As a result they make efforts to delete files while the drive is not otherwise in use.
One thing I don't understand is if you have a 520 (which has almost no internal storage) then you probably have an SD card in it and are saving your photos to that. You can remove that during the reformat so that it isn't affected. I copy all important photos to my computer anyway as well as facebook. I always tell people its important to have important files on at least 2 locations. I can promise you that they will both fail eventually. If one fails, then you have time to replace it and still have it in the other location.