JavaScript image sequencer