fix image resizing issue

Fixes http://manage.dimagi.com/default.asp?88181#505770