Gradient-Based Edge Detection - Coding problem | OneNoughtOne