You would have to custom code the link. $album->name will give you the album part. so presumably you would use
echo 'index.php?album='.pathurlencode($album->name).'&active=portfolio';
For more details see the themeing turorial and the object model docs.
BTW, we call albums albums. Gallery refers to your whole installation.