added lock option to prevent scrolling past image bounds

added lock option to prevent scrolling past image bounds