A man who downloaded indecent photographs of children has avoided immediate detention in a young offenders' institution.