Now the conversion functions support invalid image type detection. If the image is not grayscale, an exception is raised. This ensures that conversion will only happen with grayscale images. Also tables with OpenCV and ArrayFire matrix types were inserted in the code.