Is it OK to return a 301 / 302 / 303 code when returning an image resource? I have done this in the past and it seems to work. Is it good practice and is it compatible with
Yes, it works.
About being good practice, what are the alternatives? Returning an error response (404)? Not very helpful. Returning the image that the redirected resource would return? Probably not possible, otherwise you would not redirect. Fixing the img tags with the new URL? Sure, where possible, but maybe you want the browser to go thorough the redirection (a counter maybe).