The program can now run without throwing any exceptions, however the decoded images are completely worthless.