A man who repeatedly changed his WhatsApp profile picture to nude photos of his ex-partner and wrote a derogatory term on her car has avoided prison.