PNG bugfix in put function