handle large images and implement progress bar