hack to work with file system and s3 both

Hi Skarmakar  
  have you tested  it on paperclip and carrierwave both the gem with these changes .