improve gallery module, almost done