fixed bug with image downloading / encoding
removed debug comments