added check if image exsitst