Fix UIImagePickerController crash

Apparently, using the C99 trick for stack allocating variable array sizes can fail or something. Use `malloc`.