implemented image_from_bits in Sink