fix previous slide navigation logic (closes #397)