checking if image file exist before creating