Before photography: Painting and the invention of photography