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 breaks the images_ids request since it receives a undefined array. >.< This fixes it, I tested it properly now!