resolve bug in scaling image