bug fix on gradient magnitude calculation; improved gradients border image;