Fix errors with custom icon creation, but not with this commit

This will not fix the error that occurs, which is an NPE called on the
iconStream. The only issue is that the iconStream variable is declared
before the core function as null. If something inside that function
faults, it is still passing a null variable to the next portion. This
will at least uncover the error that is being caused when setting the
icons.