fix path to search template
check if image exists before making tiles