edit galleries, error checking, random fixes