Cleaned code.
Fixed error when uploading pixels.
Created internalDispose to be able to dispose from subclass.