Fix for images with non-square dimensions

In the functions offset & DIFFUSE_ERROR, the x/y offsets were swapped which caused issues when processing images with non-square dimensions