encode imagePath and fix documentation of loadFromFile