Fixed bug when image exists