That error (warning) is unrelated to the reason that you not seeing the thumbnail image. Ignore that error entirely and look for the reason that your thumbnail image it not displaying.
Put breakpoints in your code so that you can interrogate the status of variables to see where the problem is.