fixed fits image indexing bug