Gallery last item bug fixed.