Fixes VPC support when there are name collisions between the security groups

This checks if subnet is set and if so it only looks for a match on the name when the vpc_id is not None.  Otherwise, if subnet is None then it makes sure the vpc_id is also None