fixed imagecount stuff