There are several different versions of this appearing in television, however the earliest film version that I could find was the 1968 Italian film, Danger: Diabolik. Directed by de Laurentis, and a score by Ennio Morricone, it features a criminal named Diabolik who plans large heists for his girlfriend. It was an adaptation from existing comics at the time.
In this, Diabolik is planning to steal a costly emerald necklace. The only video I could find is a Spanish subtitled version. In this, starting at ~ 46:55 Diabolik scales the walls of castle to enter the room. Once in, he sees the camera, takes a Polaroid of the room and places it in front of the camera.