Replace imgbuf with ImageBuffer

Since this pull request will probably brake some stuff It would be nice if somebody could have a second look.