fix jpeg javascript bug by me