Fix a bug when get default image from database.