Replace imgbuf with ImageBuffer

Since this pull request will probably brake some stuff It would be nice if somebody could have a second look.
It only panics if `x + y * channels` is out of bounds.