added checks to raw pixelbuffer size arguments