fixed issues in gallery