Try this code to create the picture Library using Javscript:
function CreatePictureLibrary() {
var context = SP.ClientContext.get_current();
// *********** Host Web Change
var hostUrl = GetUrlKeyValue("SPHostUrl");
var hostContext = new SP.AppContextSite(context, hostUrl);
var web = hostContext.get_web();
// *********** Host Web Change
var list=web.get_lists();
var picLibCreation = new SP.ListCreationInformation();
picLibCreation.set_title("MyDocumentLibrary"); //list title
picLibCreation.set_templateType(SP.ListTemplateType.PictureLibrary); //Picture library type
list.add(picLibCreation)
context.load(list);
context.executeQueryAsync(function(){
alert(picLibCreation.title + "Created");
}, function(){
alert('Failed to Create the Document Library. Error:' + args.get_message());
});
}
If you want to create the library in Host web, change the way you generate context
, rest code remains same.