added lock option to prevent scrolling past image bounds