Fixed a small bug with the output image