Fix addPhoto method crash on 64 bit