fix jpg bug

waning: maybe cannot run correctly.