Fixing img parameters, and functionsthat deal with it.