Error with making Linked List have Images in it
<p>I'm working on a memory game and I'm trying to use a get a value from a LinkedList to put in a selected Linked List. Here is my code:</p>

<pre><code>import java.awt.GridLayout;
import java.awt.Image;
import java.io.IOException;
import java.io.InputStream;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.ArrayList;
import java.util.Random;

import javax.imageio.ImageIO;
import javax.swing.JFrame;


public class Runner{

    public static void main(String[] args) {
        JFrame frame =  new JFrame();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        LinkedList&lt;Image&gt; icon = new LinkedList&lt;Image&gt;();


        for (int i = 0; i &lt; 20; i++) {
            ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
            InputStream input = classLoader.getResourceAsStream((i + 1) + ".jpg");
            try {
                Image logo = ImageIO.read(input);
                icon.push(logo);
            } 

            catch (IOException e) {
                e.printStackTrace();
            }
        }


        Random rand = new Random();

        LinkedList&lt;Image&gt; selected = new LinkedList&lt;Image&gt;();

        for (int i = 0; i &lt; 10; i++) {
            int randomNum = rand.nextInt(20);


            // Randomly pick one from the array of faces
            Image face = icon.get(randomNum);
            // Push 2 copies onto array
            selected.push(face);
            selected.push(face);
            // Remove from faces array so we don't re-pick
            icon.remove(randomNum);
        }

        Collections.shuffle(selected);  





        List&lt;Card&gt; tiles = new ArrayList&lt;Card&gt;();




        int NUM_COLS = 5;
        int NUM_ROWS = 4;

        frame.setLayout(new GridLayout(NUM_ROWS, NUM_COLS));


        for (int i = 0; i &lt; NUM_COLS; i++) {
            for (int j = 0; j &lt; NUM_ROWS; j++) {
                tiles.add(new Card(i * 39 + 10, j * 39 + 40, selected.pop()));
            }
        }

        for (int i = 0; i &lt; tiles.size(); i++) {
            frame.add(tiles.get(i));
            tiles.get(i).drawFaceDown();
        }

        for (int i = 0; i &lt; tiles.size(); i++) {
            frame.add(tiles.get(i));
            tiles.get(i).drawFaceUp();
        }

        frame.pack();
        frame.setVisible(true);



        }
}
</code></pre>

<p>My problem is that I've tried putting images in my icon LinkedList however I'm getting an error:</p>

<pre><code>Exception in thread "main" java.lang.IllegalArgumentException: input == null!
    at javax.imageio.ImageIO.read(Unknown Source)
    at Runner.main(Runner.java:30)
</code></pre>