First of all,check out this image Gmail uses this image to display the
Set the background image of an element to the first image, then use javascript to change the image by altering the style every x milliseconds.