shouldn't this be `if(stride!=width*height*channels)`?