WebCLTransformer: add a check around WriteImage

This fixes issue #66.

Also declared write_imagef in kernel.cl for image2d_t.