Fixing image python script