refact s3 thumbs/attach and fixing tests