Javascript chart image cycling works