added s3 support.
open bug - certain images causes truncation of data from sql and thus inconsistency