fix bug and optimize images