fixed addgallery func