fixed image sampling method
fixed (find-)bugs