Intranuclear cascading in photographic emulsion at accelerator and cosmic- ray energies