fixed UI bugs in gallery and index