A convicted sex offender who begged magistrates to send him back to prison has been jailed after viewing indecent images of children again.