Constraints on the bulk Lorentz factor in the internal shock scenario for gamma-ray bursts