Add png extension only when needed

Signed-off-by: Guilhem Pujol <guilhem.pujol@gmail.com>