Slide puzzle in HTML5 and js