Given surfaces $A$ and $B$ as below :
Note that $A$ is obtained by collapsing all boundary to a point (all purple lines and points to one point) and $B$ is obtained by collaping red part to one point, green part to another point and glue $a$ with $a'$.
It is clear that $A$ is homeomorphic to the $2-$sphere $S^2.$
I think $B$ should be homeomorphic to $S^2$ as well, but not sure how to prove this rigorously.
First, the collapsing map which collapses the yellow strip $l$ to a diagonal maps $B$ to $A$, but clearly not 1-1 so not a homoemorphism.
Technically, $B$ is like stretch one of the diagonals of $A$ to the strip $l$ in the interior of $B$. Perheps, the correct notion is $A$ and $B$ has the same homotopy type. But I am not sure since only part of $A$ is stretched, this seems to be a trouble in building a continuous homotopy $f,g$ so that $fg, gf \sim$ identity.
Anyone has suggestion to show that $B$ is homeomorphic to $S^2$ (i.e. closed surface with genus $0$) ?
Visulization of surfaces $A$ and $B$ : 
Note : The right line on B should be colored green as well.

In $B$, the (left) blue polygon with a partially red border collapses to a disk (although it is perhaps easier to see this as a hemispherical cap on the end of the yellow tube) and so does the (right) blue polygon with partially green border. So we should arrange for one cap-like region to become the left polygon. Then an annulus around it becomes the yellow region, which we must cut to create the $a$ and $a'$ edges -- so we must cut the cap to get the red border. Then there is very little choice for where the right polygon is...
Cut along red/blue/green line. Collapse purple boundary to a point (which point lands in the interior of the right blue polygon in $B$). You obtain
Here, the two red arcs and three red vertices in $B$ are explicit, the two green arcs and three green vertices are explicit (one is the purple arc, which is contracting to a green vertex) and the gluing along the two blue edges is explicit.