Mechanisms of photocatalysis in TiO2 thin films for air purification