I’ll state my simple and elegant solution to this sort of thing:
Take the pictures. Bake the cake. Do it to your usual standards (this avoiding further lawsuits)
By state clearly and upfront that all profits from the work will be donated to a Christian organization that offers gay conversion therapy.
And watch as the legal threat to your business suddenly vanishes.
I would not find that acceptable, if I were the photographer. I prefer writing the contract specifying no penalty and no payment in case of non-performance, and then in some manner not delivering or cancelling at the last minute. As long as the contract is well-written (as it should be in all cases regardless of controversy), the thugs won't be able to sue successfully. Expressively supporting evil is not an acceptable option, whether or not you keep the money that those who demand your service condescend to pay.