Constraints on the mass spectrum of primordial black holes and braneworld parameters from the high-energy diffuse photon background