An Edinburgh man who was caught with hundreds of shocking child abuse images - including two-year-old victims - has been sentenced to an alternative to a jail sentence.