Incorporation of density fluctuations into photoionization calculations