Fixed bug that caused gallery to skip last image
Fixed bug that caused gallery to skip last image