Issue #2215369 by fietserwin, svanou: Fixed PHP 5.5 imagerotate() fails when incorrect color indices are passed in.