fixed bug with rendering image