A community order has been handed to a man who was caught with over 9,400 indecent images of children.