Thaw fish, if frozen. Rinse fish; pat dry with paper towels. Place each fillet on a 12-inch square of heavy foil. Fold under thin edges of fillets to make even thickness.
In a small bowl stir together lemon juice, shallots, pepper, and garlic; spoon over fish. Top with pesto. Bring together two opposite edges of foil and seal with a double fold. Fold remaining ends to completely enclose food, allowing space for steam to build. Place foil packets in a 15x10x1-inch baking pan.