fixed crash and image problem

Ignore-this: a44fbaaabf42a765e4f61da654a284ec

darcs-hash:20140411225538-c21fe-d3312f44c94eeb74ab49d193c43e98462c244082