fix for my mistake

I'm sorry, I made a bad mistake and put the line which defines the contacts array also in the if block. Of course this breakes the images_ids reques since it receives a undefined array. >.< This fixes it, I tested it properly.
Merge pull request #579 from TitanNano/dev

fix for my mistake