fix a bug where commits weren't added to remote galleries if the gallery was empty and objectify the gallery