Optimizing request for images and adding a test