A convicted Wigan borough sex offender who made indecent images of children and committed multiple breaches of a sexual harm prevention order has narrowly avoided an immediate spell behind bars.