test image loading by if statement in template