added timeout to image processing