It was still running extremely slowly, so I also uninstalled the Windows Photo app, which still seemed to think all these folders still existed and was showing blank squares where the photos should have been. Finally I did a few more random things, which involved logging into my Windows account and, inadvertently setting a password for my computer, which (I hope!) I have now managed to switch off. The virus checker also warned me about a couple of suspicious files, so I delete those to be on the safe side.
Things do, finally, seem to be running better. I really don't want to have to buy a new computer. It's not just that we've spent quite a lot of money recently, but it is such a hassle copying stuff over and installing all the software I use. So my fingers are crossed and we'll see how it goes.