(core+lua) added 'resample_image' function