Fixed bug when adding image.