Fix for encoding image when pixelsize=3

When pixel size = 3, arraycopy must be removed otherwise will get bufferunderflow exception.
The two lines are enough to correctly encode the image!