make sure the photo is always within bounds