A rope is attached to the two upper corners of a rectangular picture (each end of the rope to one corner). How to hang this picture on a wall, using two nails, so that if you remove one nail (ANY OF THE TWO) the picture will fall?

(The picture should hang on the rope while both nails are present).

Same question with any given number of nails. An illustration from the Complex Variables course by Walter Bergweiler, Kiel University,
A picture hanging on 8 nails in the University of Helsinki.

Spoiler