sclang: Move image primitive helper functions into a separate header

Signed-off-by: Scott Wilson <i@scottwilson.ca>