Optically uniform thin films of mesoporous TiO2 for perovskite solar cell applications