During the last decades, much effort has been devoted to explain the discrepancy between the amount of intracluster medium (ICM) estimated from stellar evolution theories and that emerging from observations in globular clusters (GCs). One possible scenario is the accretion of this medium by an intermediate-mass black hole (IMBH) at the centre of the cluster. In this work, we aim at modelling the cluster colour-excess profile as a tracer of the ICM density, both with and without an IMBH. Comparing the profiles with observations allows us to test the existence of IMBHs and their possible role in the cleansing of the ICM. We derive the intracluster density profiles from hydrodynamical models of accretion onto a central IMBH in a GC and we determine the corresponding dust density. This model is applied to a list of 25 Galactic GCs. We find that central IMBHs decrease the ICM by several orders of magnitude. In a subset of 9 clusters, the absence of the black hole combined with a low intracluster medium temperature would be at odds with present gas mass content estimations. As a result, we conclude that IMBHs are an effective cleansing mechanism of the ICM of GCs. We construct synthetic extinction maps for M 62 and ω Cen, two clusters in the small subset of 9 with observed 2D extinction maps. We find that under reasonable assumptions regarding the model parameters, if the gas temperature in M 62 is close to 8000 K, an IMBH needs to be invoked. Further ICM observations regarding both the gas and dust in GCs could help to settle this issue.