fix image request before variable is loaded