You could take the hard drive out of the 2014 iMac, and use it for your backups, but I wouldn't. It would be a lot of work to salvage an old drive.
That Mac has a very nice 27" 5K Retina display, USB 3.0 ports, and upgradable RAM. It can run Big Sur – which is outdated now, but enough to run current versions of FireFox and LibreOffice. There might well be some school or charity or senior center in your community who could make use of the machine for running Firefox and LibreOffice if you don't have any use for it any more.
Whatever you do with it, you might want to read:
What to do before you sell, give away, trade in, or recycle your Mac - Apple Support
P.S. - I would suggest backing up your photos to at least two places. Backup drives – even new ones – can fail or be burned up in fires or be stolen. When you've lost access to your original data is NOT the time you want to find out that you cannot count on your one and only backup.