Add image_get_samples function