Study of the rare decay K+→π+γγ at the NA62 experiment