Identification of painting as 17th-century masterwork brings joy to parish