start to implement galleries function