Scans for images in a directory and Optimizes them