Python image distortion in CodeIgniter framework