Support non-jpeg in new photo function