Track a tennis ball through successive images; JavaScript