The Gamma-Ray Detection Capabilities of the Alpha Magnetic Spectometer