Retry getInputStream

Added a retry to getInputStream method. Default 3 total tries.