optimize images and styles