Actually use the error code from tjCompress() by logging the errors.
Make sure width is more than zero before filling the pad with the last
pixel data.
If the image width is not divisible by 4, the image is padded to the next
multiple of 4. The additional pixels are filled with the colors of the
last pixel in the row.
The last pixel colors may not be initialized if the width is 0. In this
case, the would be no padding, but the compiler doesn't know that.
Add a check that the width is more that 0 before filling the padding.