Bug fixes for processing images.