try to fix OutOfMemory in uploading pictures.