Deformation of Line bundles over dual numbers

Let $X$ be a scheme over a field $k$ and $L$ be an invertible sheaf on it. Let $D$ be the scheme over dual numbers over $k$ with parameter $t$, i.e. $Spec(k[t]/(t^2)$.

Let $X':=X \times_k D$ and $i:X \rightarrow X\times D$ the natural map.

One defines a first order deformation of $L$ over $D$ as a line bundle $L'$ on $X'$, such that $i^*L'$ is isomorphic to $L$.

One knows that the iso classes of deformations of $L$ correspond to $Ext^1_{\mathcal O_X}(\mathcal O_X, \mathcal O_X)$.

One map is clear, I think: if you have a deformation $L'$, then consider the exact sequence on $D$:

$0 \rightarrow k \rightarrow \mathcal O_D \rightarrow k \rightarrow 0$, pull it back to $X'=X\times_k D$, tensor with $L'$ and push down to $X$. Please correct me if this is not the right way.

But how do I get explicitly a deformation in the sense of the above definition out of an exact sequence on $X$

$0\rightarrow L \rightarrow M \rightarrow L \rightarrow 0$?

In the books I read there are only hints I really don't understand, so I would be very glad about an answer which carefully constructs the deformation data out of this sequence.

-
A short exact sequence $0 \to L \to M \to L \to 0$ enables you to give $M$ the structure of a module over $X'$. You just need to be able to say how $\epsilon$ acts on $M$. Composing the projection $M \to L$ with the inclusion $L \to M$ tells you how $\epsilon$ acts. –  Mike Skirvin Nov 8 '11 at 16:28
Well, exactly this is what appears in the books and what I don't fully understand, even not in terms of modules. Above all, why is $i^*L'$ isomorphic to $L$? –  Veen Nov 8 '11 at 17:12

One important point is that $X$ and $X'$ have the same topological space, since $i:X'\rightarrow X$ is a nilpotent immersion. In particular $M$ is already a sheaf on $|X|=|X'|$ (of $\mathcal{O}_X$-modules). Since $\mathcal{O}_{X'}=\mathcal{O}_X\oplus \mathcal{O}_X[\varepsilon]$, to give $M$ the structure of a sheaf of $\mathcal{O}_{X'}$-modules you only need to define the action of $\varepsilon$, as Mike Skirvin points out in his comment.
So you define multiplication by $\varepsilon$ by the composition $M\stackrel{g}{\to} L\stackrel{f}{\to} M$ of the two maps given by the extension (notice that this is $\mathcal{O}_X$-linear, and its square is zero). This makes $M$ a sheaf of $\mathcal{O}_{X'}$-modules, and moreover using the local criterion of flatness you can check that it is flat over the base $D$.
Now since $|X|=|X'|$ and $\mathcal{O}_X=\mathcal{O}_{X'}/(\varepsilon\cdot\mathcal{O}_{X'})$, you have $i^*(M)=M\otimes_{\mathcal{O}_X'}\mathcal{O}_X=M/(\varepsilon \cdot M)=M/f(L)=L$, since by definition of the action of $\varepsilon$, $\varepsilon \cdot M=f(L)$.
@Mattia: is this $M$ with the $\mathcal O_{X'}$-structure you defined a line bundle on $X'$? It should be given the above definition of deformation. –  Veen Nov 8 '11 at 18:09
I think so, if say $X$ is loc noetherian. Take an open affine $U=Spec A \subseteq X$ (so the corresponding open of $X'$ is the spectrum of $A'=A[\varepsilon]$) and apply the local criterion of flatness for the nilpotent ideal $(\varepsilon)\subseteq A[\varepsilon]$ to the restriction of $M$ to $U$, call $N$ the corresponding $A'$-module. Namely, since $N/(\varepsilon N)$ is flat over $A$ (loc free even) and $Tor_1^{A'}(N,A)=0$ (check that $\cdot \varepsilon: A\to A'$ stays injective after tensoring with $N$), then $N$ is flat over $A'$, so it is locally free. (maybe there's an easier way..) –  Mattia Talpo Nov 8 '11 at 20:27
Well, but one needs locally free of rank one as one wants it to be a line bundle on $X'$. But I think it really is, due to local splittings of the sequence $0\rightarrow L \rightarrow M \rightarrow L \rightarrow 0$ ($L$ is locally just the structure sheaf and so you get a retraction). Does this sound reasonable? –  Veen Nov 9 '11 at 12:35
Once you know that it is locally free, it must be of rank one, since its pullback to $X$ is.. –  Mattia Talpo Nov 9 '11 at 13:00