Fixed crash in freehand drawing tool when points are outside of image area