Fixed memory corruption when sending pictures