restrict an image movement