Sheffield Wednesday striker Caolan Lavery has signed a new long-term contract with the Sky Bet Championship club.