A former firefighter caught with indecent images of children fantisised about being involved in the gang rape of a little boy, a court has heard.