Is it safe to install a deprecated Java version?
I don’t consider java a safe tool to install period. Unless you have a very compelling reason, or some specific threat model, don’t install java if you want security in your Mac.  It’s worse to install older versions that don’t get current security patches in general.  

I’d look at something like Pixelmator or Acorn or even a newer Photoshop since your photoshop won’t get security patches anymore either.

https://www.engadget.com/2013/05/14/pixelmator-and-acorn-economic-practical-image-editors/

Your mitigation steps in additional details are all solid and well reasoned and each reduces your risk to security. so I can’t say the risk wouldn’t be worth it to you once you evaluate the alternatives I’ve mentioned. 

I can say, I’d choose to not use photoshop CS 5.1 and java in my case.