Method and apparatus for quantizing and dequantizing of image signals