fix utf-8 encoding, add option for image size