Fix image upload and decoding.