It appears that you haven't modified the call site to pass the rotation and mirrored arguments to this function.

Also the code at the call site will be much easier to read if you keep the callback as the last argument.  Model this after createThumbnailFromPoster, please.