def adjust_gamma(array_in, gamma):
    """
    Replacement function for skimage.exposure.adjust_gamma, so that NaNs don't throw errors
    
    Parameters
    ----------
    array_in : array
        Input image array
    gamma : float  
        Gamma correction value
    
    Returns
    -------
    array
        Gamma-adjusted image values
    """
    return array_in ** float(gamma)
