A federal judge scolded the government on Wednesday for being overprotective of potentially disturbing images of how the military treated prisoners in Iraq and Afghanistan and proceeding as if court review of its decisions about the pictures should not exist.