Added addToFileIdPinList method to loadImage

It was previously in writeImage erroneously.
Merge pull request #179 from manugoyal/add-pin-list

Added addToFileIdPinList method to loadImage