That’s why they make .22 cal ammo.
http://media.midwayusa.com/ProductImages/Large/135961.jpg
or these if your .22 doesn’t like the heavy bullet.
http://www.jgsales.com/images/1%2022LR%20Aguila%20A269%2040GR%20Subsonic%205001457.jpg
A 17 HMR should be safer and less prone to ricochet than a 40 gr 22 Long Rifle.
The trajectory for a 17HMR Hornaday 17 gr Bullet (Muzzle Velocity of 2550 fps) with a scope height of 1.5" sighted in for 125yds is 0.94" high at 75 yds, on at 125 and 1.22" low at 150 yds.
For shooting where noise may be a factor the Gamo Whisper Air Rifle .177 caliber is very quiet, per field testing.