Similarity solutions for immiscible phase migration in porous media: an analysis of free boundaries