When Castle is given the piece of paper by his CIA GF it was folded to a 1/8 of a sheet (to fit into her bra). When he presents it to Beckett it is folded to a 1/4 of a page and creases from more folding are nowhere to be seen. It is obviously a different piece of paper.
The facial recognition program is shown as scanning through multiple images per second. This is not how facial recognition works. A picture is reduced to a series of values, the values are weighted, and then compared just like other numerical sets.