Image - Mesh Subsampler - Python

Hi, recently I been trying to create a component that generates a Mesh with a base depthmap(Image), I know there is the IMG component from the standard grasshopper library, and other components in firefly and… But in my case I need be able to pass a System.Drawing.Bitmap instead of a file-path on the input. I have upload the file with the component. Everything seem’s to work fine but in some cases the mesh doesn’t generate, or it splits in half.
So, I was wondering if someone could give me some advice on how to correct this error I Believe if is related to the seq() function.Thanks