We investigate the relationship between the quasi-thermal baryon-related photosphere in relativistic outflows, and the internal shocks arising outside them, which out to a limiting radius may be able to create enough pairs to extend the optically thick region. Variable gamma-ray light curves are likely to arise outside this limiting pair-forming shock radius, while X-ray excess bursts may arise from shocks occurring below it; a possible relation to X-ray flashes is discussed. This model leads to a simple physical interpretation of the observational gamma-ray variability-luminosity relation.