Implementing picture puzzle game logic