In your example they would go after whoever has the internet service that was assigned the IP. If you let people use your computer & internet connection you are liable for what happens.
That should not be the case. I find such arbitrary laws to be reprehensible, if for no other reason than because the bitter ex could come for a friendly visit and then post a "revenge" video of herself just for the purpose of having her ex prosecuted. Bad laws are bad laws, and this is one (note: I have never made, posted, or even possessed such a video/picture; I'm not a player in this sort of game). The idea that someone with no computer password (or a password the ex can guess) could spend five years in prison for bad judgement, disgusts me.