A man found with half a million pornographic images, including hundreds of children, has been jailed for six months.