Use the pnmcat
of the netpbm-package.
You probably have to convert your input files to and fro for using it:
pnmcat -lr <(pngtopnm 1.png) <(pngtopnm 2.png) | pnmtopng > all.png
EDIT:
As user Hashbrown pointed out in a comment, this might have trouble with different sizes and/or transparency in the PNGs. To circumvent that he came up with this solution (just copying it here because the Q is closed and new answers cannot be added):
pnmcat -jleft -tb \
<(pngtopnm image139.png) \
<(pngtopnm image73.png) \
| pnmtopng \
-alpha <(pnmcat -black -jleft -tb \
<(pngtopnm -alpha image139.png) \
<(pngtopnm -alpha image73.png) \
) \
>test.png
I didn't test that solution, though.