Add image sampling functions