public void Update() {
        for (int i = 0; i < yPositions.length; i++) {
            // Move image
            yPositions[i] += speed;

            // If image moving left
            if (speed < 0) {
                // If image is out of the screen, it moves it to the end of line of images.
                if (yPositions[i] <= -image.getHeight()) {
                    yPositions[i] = image.getHeight() * (yPositions.length - 1);
                }
            } // If image moving right
            else {
                // If image is out of the screen, it moves it to the end of line of images.
                if (yPositions[i] >= image.getHeight() * (yPositions.length - 1)) {
                    yPositions[i] = -image.getHeight();
                }
            }
        }
    }