I don't know what advice to give. I have been in your wifes shoes except for the nude pics and actually leaving. I always threatened divorce. Until he filed.....
The only thing I can say is be strong, think about where it went wrong, find yourself. Don't beg, get to the mindset that this is what she really wants and you are going to make it, even if you have to fake it. Fix yourself.