implement most part of gallery