fix scroll bug when imaged is zoomed in and simplify code