Effect of gain lineshape on amplification of localized modes in active random media