Fix conversion to uint8

Closes #44

New image_as_uint8() function that plugins can use to
convert image data to uint8.