How to check if an image file exists already