Intermediate polymer to carbon gas separation membranes based on matrimid PI