First thoughts:
I would first try and add every piece in turn
geometrically (where does the piece fit tightly ?),
by colors (in case different pieces fit at the same place).
For this, you will maintain a picture where the previous pieces have been placed, with the background color being reserved.
Before trying a new piece, you have to obtain the boundary of the free area, which is a curve. (After adding a piece, the update of this curve can be made locally).
Then take a piece and choose a point on its outline. By sweeping this point on the curve, you can find a place where it fits, with a significant overlap. Keep the piece that realizes the longest fit.
In case of ties (or quasi-ties), check the colors with a similarity score such as SAD.
This will be horribly time consuming, though.
Second thought:
There is probably now way to know the exact orientation of the pieces (unless some part of the outline is guaranteed to be horizontal/vertical). Trying different angles will worsen the running time.
An alternative is to pick two points, some known distance apart on the outline of a piece. Then you slide the first point on the boundary curve and find the position of the other point, ahead on the outline and respecting the distance constraint.
Update:
If the pieces are all identical, the geometric search becomes irrelevant. But the good news is that the placement of the pieces becomes highly predictable (the pieces are just on a regular grid).
So every piece can be tried in turn at the desired place, and the correct match be based on the colors of the known image, or on the colors in the neighboring piece(s), along the common edge(s).
It is advisable to put the pieces that achieve the best match first, in order to minimize the probability of false matches.