Thermally induced optical bistability in thin film devices