Added panning and keeping image on edge