@DZandaa,
thanks for the source.
I tried quickly and seems that there some issues about x, y coordinates (may be exchanged) and generate an AV in various point of your source.
Try with an image with Height <> Width.
I have not time now to debug and report the corrections, but I'll do in the next time.