Added image output functionality