Judge Tompkins said Keating had been assessed as having a "high likelihood of reoffending, and high risk of harming others".
The judge said home detention would "do little to mitigate that risk, despite restrictive conditions".
A prison sentence, however, meant a psychological assessment and the possibility of a "proven" intensive rehabilitation programme either in Christchurch or Auckland.
The judge said he drew no distinction between "direct" child sex offences and the use of child pornography.
"These were extraordinarily vulnerable victims; the fact that they are not in New Zealand is irrelevant," Judge Tompkins said.
"The kinds of images that he accessed and distributed ... I don't think it's an appropriate distinction to make."