A convicted paedophile who was caught with a cartoon of a naked girl on his phone has been given a suspended prison sentence.