Histogram not updating after image change