Fix for public machine image search.

There were some minor logic issues in searchMachineImage and searchPublicImages methods. 

Tested in dev.

In 2013.04 the  method searchMachineImage does not exist and the searchPublicImages method is different, so I only created a pull request for 2013.02.

Binod