fix image management
fix var collision