add functions to check for existence of images