Gallery arrows functionality has been refactored with js closures