I don't get it
First you say you want to replace the button with a gif image, then you are talking about adding an image to an input value ...
How about having both elemens (the button and the image) next to each other in your markup, where the image is hidden initially? Then on click of the button you hide the button and show the image. This will look like the image replaces the button.