Conditional handling for the images directory