Refactored code, endless scrolling works, but there is a bug where it stops working if you scroll through all 64 images