Why did Shiro have Rin's pendant, if Rin's pendant was returned to her by Archer? In the prologue to Unlimited Blade Works, we see Rin drop her pendant after saving Shiro's life. She doesn't bother picking it up, and later, Archer returns it to her.

However, in the first "main" episode, we see that Shiro picks up the pendant and takes it home after he is revived, and he doesn't encounter Archer until the next day. So it doesn't seem like Archer could have intercepted him at some point and retrieved the pendant. Moreover as additional support for this, when in episode 12, he topples Rin's jewelry chest, he sees her pendant and notes that it's exactly the same as the one he remembered seeing that night. So it looks like Shiro believes the pendant he finds at Rin's house is different from the one he has.

Is there a contradiction or omission here? It doesn't seem like Rin has more than one pendant, from the narration in the beginning of UBW.
I've only just started the second season, but from a combination of the material here and what I've gleaned from sources like the Wikia, I have something of an answer.

There is no contradiction or omission, in that there isn't only a single pendant involved in the series. In the first episode of the second season, we have this exchange.

[Shiro shows Rin the pendant.]
Rin: Huh? How did you get that?
Shiro: Anyway, you can have it back. I have another pendant like it at my house. After Lancer nearly killed me at school, it was lying next to me. I picked it up, and I've had it ever since.

To this, Rin seems surprised. So barring any weird, supernatural duplication, there must be more than one pendant.
N.B.: it seems that Rin's pendant is unique. Archer tells Rin that she shouldn't lose it again back in the beginning, and that it suits her (and not others). From both my guess and the Wikipedia episode list, it looks like Shiro was returning the pendant from Rin's room, although the English dialogue isn't completely clear on this. (I could not tell if Shiro's explanation for having one of the pendants was supposed to explain why he had the one he was returning. But this is more plausible, and perhaps Shiro didn't realize that the pendant lying next to him after he almost died was necessarily Rin's, even if he remembers her in the hallway.)

However, this doesn't explain where Archer got the pendant he returned to Rin. Now, Archer's true identity is:

 Shiro of an alternate timeline from that of Fate/stay night [...] He is summoned because he still has the jewel pendant that Rin used to save his life after Lancer stabbed his heart. The jewel he owns is the actual catalyst used for his summoning rather than the one that Rin still has at the time of his summoning. (Source: Wikia)

So it must simply be that

 Archer gave Rin his own pendant (which he obtained from her in another timeline in a similar fashion to this one), and implicitly lied about picking it up.


Update: I'm watching the UBW movie now, and Shiro tells Rin when returning the pendant that

I didn't realize [it was yours] until I saw one with the same shape in your home.

So I'm not sure if the conclusion I gleaned from Wikipedia about which pendant was being returned was right. The anime series would suggest that he simply took the pendant out of Rin's chest and is returning that one, but here, it looks like Shiro is returning the pendant that he'd kept after being revived.
Update 2: the visual novel (which I would consider &quot;canon&quot;) makes it clear that Shiro is simply returning the pendant he found at Rin's house (i.e. the one Archer &quot;returned&quot;), when he explains to Rin where he found the pendant he's returning:

I found it in your room. Oh . . . You might get surprised when you get home, but I'm sorry. I tipped over your dresser . . . Well, I have the exact same pendant at my house.