fix bugs displaying pictures