some magic numbers introduced in mouse events and in selection object to prevent drawing and moving of rectangle object outside the image region